str2mat - Form blank-padded character matrix from strings
Syntax
S = str2mat(T1, T2, T3, ...)
Description
S = str2mat(T1, T2, T3, ...) forms
the matrix S containing the text strings T1, T2,
T3, ... as rows. The function automatically pads each string with
blanks in order to form a valid matrix. Each text parameter, Ti,
can itself be a string matrix. This allows the creation of arbitrarily large
string matrices. Empty strings are significant.
Note
This routine will become obsolete in a future version. Use char instead. |
Remarks
str2mat differs from strvcat in
that empty strings produce blank rows in the output. In strvcat,
empty strings are ignored.
Examples
x = str2mat('36842', '39751', '38453', '90307');
whos x
Name Size Bytes Class
x 4x5 40 char array
x(2,3)
ans =
7See Also
char, strvcat
 | str2func | | str2num |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit