S = str2mat('t1','t2','t3',...)
S = str2mat('t1','t2','t3',...)
forms the matrix S
containing the text strings t1,
t2,
t3,
etc. as rows. str2mat
automatically pads each string with spaces in order to form a valid matrix. Up to 11 text strings can be used to form S
. In addition, each text parameter, tn
, can itself be a string matrix. This allows the creation of arbitrarily large string matrices.
'One'
, 'Twenty'
, and 'Thirty-six'
:
s = str2mat('One','Twenty','Thirty-six')
s =
One
Twenty
Thirty-six
int2str
,isstr
,num2str
,setstr
(c) Copyright 1994 by The MathWorks, Inc.