[Master Index] [Index for Toolbox]

str2mat0

(Toolbox/str2mat0.m in BrainStorm 2.0 (Alpha))


Function Synopsis

s=str2mat0(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11)

Help Text

STR2MAT0 - (Deprecated) Form text matrix from individual strings.
 function s=str2mat0(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11)
 Adapted from Mathworks:
STR2MAT Form text matrix from individual strings.
 S = STR2MAT(T1,T2,T3,..) forms the matrix S containing the text
 strings T1,T2,T3,... as rows.  Automatically pads each string with
 spaces in order to form a valid matrix.  Up to 10 text strings 
 can be used to form S.  Each text parameter, Ti, can itself be a 
 string matrix.  This allows the creation of arbitarily large
 string matrices.

 Modified by John C. Mosher, Oct 17, 1996 to ignore a null string input
 23-Mar-2002 Deprecated, use cellstr to convert strings to cells,
  use char to convert cells to a string mat.

Cross-Reference Information

This function is called by

Listing of function C:\BrainStorm_2001\Toolbox\str2mat0.m

function s=str2mat0(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11)
%STR2MAT0 - (Deprecated) Form text matrix from individual strings.
% function s=str2mat0(t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11)
% Adapted from Mathworks:
%STR2MAT Form text matrix from individual strings.
% S = STR2MAT(T1,T2,T3,..) forms the matrix S containing the text
% strings T1,T2,T3,... as rows.  Automatically pads each string with
% spaces in order to form a valid matrix.  Up to 10 text strings 
% can be used to form S.  Each text parameter, Ti, can itself be a 
% string matrix.  This allows the creation of arbitarily large
% string matrices.
%
% Modified by John C. Mosher, Oct 17, 1996 to ignore a null string input
% 23-Mar-2002 Deprecated, use cellstr to convert strings to cells,
%  use char to convert cells to a string mat.

%<autobegin> ---------------------- 26-May-2004 11:34:31 -----------------------
% --------- Automatically Generated Comments Block Using AUTO_COMMENTS ---------
%
% CATEGORY: Utility - General
%
% At Check-in: $Author: Mosher $  $Revision: 14 $  $Date: 5/26/04 10:02a $
%
% This software is part of BrainStorm Toolbox Version 2.0 (Alpha) 24-May-2004
% 
% Principal Investigators and Developers:
% ** Richard M. Leahy, PhD, Signal & Image Processing Institute,
%    University of Southern California, Los Angeles, CA
% ** John C. Mosher, PhD, Biophysics Group,
%    Los Alamos National Laboratory, Los Alamos, NM
% ** Sylvain Baillet, PhD, Cognitive Neuroscience & Brain Imaging Laboratory,
%    CNRS, Hopital de la Salpetriere, Paris, France
% 
% See BrainStorm website at http://neuroimage.usc.edu for further information.
% 
% Copyright (c) 2004 BrainStorm by the University of Southern California
% This software distributed  under the terms of the GNU General Public License
% as published by the Free Software Foundation. Further details on the GPL
% license can be found at http://www.gnu.org/copyleft/gpl.html .
% 
% FOR RESEARCH PURPOSES ONLY. THE SOFTWARE IS PROVIDED "AS IS," AND THE
% UNIVERSITY OF SOUTHERN CALIFORNIA AND ITS COLLABORATORS DO NOT MAKE ANY
% WARRANTY, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
% MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, NOR DO THEY ASSUME ANY
% LIABILITY OR RESPONSIBILITY FOR THE USE OF THIS SOFTWARE.
%<autoend> ------------------------ 26-May-2004 11:34:31 -----------------------


% See JCM tagged comments below

%    Clay M. Thompson  3-20-91
%    Copyright (c) 1984-94 by The MathWorks, Inc.

nstrings = nargin;

% Determine the largest string size.
nrows = zeros(1,11); ncols = zeros(1,11);
for i=1:nargin
  sizecall = ['size(t',int2str(i),')'];
  [m,n] = eval(sizecall);
  nrows(i) = max(1,m);
  ncols(i) = n;
end

% Now form the string matrix.
s = []; space = ' '; len = max(ncols);
if len == 0,
  t1 = ' ';
  ncols(1) = 1;
  len = 1;
end;

for i=1:nargin
  j = int2str(i);  
  % JCM: test to see if string is empty
  eval(['nextstr = t' j ';']);    % JCM
  if(~isempty(nextstr)),    % JCM, if not empty, then proceed
    formcall = ['[s;[t',j,',space*ones(nrows(',j,'),len-ncols(',j,'))]]'];
    s = eval(formcall);
  end                % JCM
end


Produced by color_mat2html, a customized BrainStorm 2.0 (Alpha) version of mat2html on Tue Oct 12 12:05:14 2004
Cross-Directory links are: ON