str2mat
Returns a string matrix, R, whose elements are inputs, s, vertically concatenated. Strings that form the rows R are padded with spaces so that R is valid.
Syntax
R = str2mat(s,...)
Inputs
- s
- s must be a string or cell array of strings.
Outputs
- R
- Type: string | mat
Examples
String
inputs:
R = str2mat('This', 'is', 'vertically', 'concatenated')
R =
This
is
vertically
concatenated
Scalar, string, and cell array inputs:
R = str2mat(75, 'char example', {'Cell element 1', 'Cell element 2'}, [65;66;67], [65,66,67])
R =
K
char example
Cell element 1
Cell element 2
A
B
C
ABC