Functions | |
elseif (nargin > 1) numstrs(nargin)=0 | |
elseif (isreal(varargin{nv})) varargin | |
elseif (isempty(varargin{nv})) varargin | |
elseif (iscell(varargin{nv})) allchar | |
else | error ("strcat: inputs must be strings or cells of strings") |
numstrs (nv) | |
else | error ("strcat: arguments must be the same size, or be scalars") |
endif endfor endfor | if (allchar) st |
endif endif else | print_usage () |
endif endfunction | !assert (strcat("ab ","ab "),"abab")%!assert(strcat( |
!assert (all(strcmp(strcat("a",{"bc","de"},"f"),{"abcf","adef"})))%!assert(all(strcmp(strcat(["a" | |
!assert (all(strcmp(strcat({"a","bb"},"ccc"),{"accc","bbccc"})))%!assert(all(strcmp(strcat("a" | |
!assert (strcat(1, 2), strcat(char(1), char(2)))%!assert(strcat('' | |
Variables | |
function | st |
allchar = true | |
for | nv |
endfor | n = find (numstrs == max (numstrs), 1) |
maxstrs = numstrs (n) | |
dim = dims{n} | |
for | ns |
ab | |
b | |
c |
!assert | ( | strcat(1, 2) | , | |
strcat(char(1), char(2)) | ||||
) |
!assert | ( | all(strcmp(strcat({"a","bb"},"ccc"),{"accc","bbccc"})) | ) |
!assert | ( | all(strcmp(strcat("a",{"bc","de"},"f"),{"abcf","adef"})) | ) |
endif endfunction !assert | ( | strcat("ab ","ab ") | , | |
"abab" | ||||
) |
elseif | ( | iscell(varargin{nv}) | ) |
elseif | ( | isempty(varargin{nv}) | ) |
elseif | ( | isreal(varargin{nv}) | ) |
elseif | ( | nargin | , | |
1 | ||||
) | [pure virtual] |
numstrs | ( | nv | ) |
allchar = true |
b |
c |
maxstrs = numstrs (n) |
endfor n = find (numstrs == max (numstrs), 1) |