convertContainedStringsToChars
Convert string arrays at any level of cell array or structure
Description
To make your code accept cell arrays and structures that contain strings as input
arguments, add a call to convertContainedStringsToChars
to the beginning
of your code. Then you do not have to make any other changes to code that you had written to
work with cell arrays or structures containing character arrays.
B = convertContainedStringsToChars(
converts
string arrays at any level in A
)A
.
If
A
is a string array, thenB
is a character vector or cell array of character vectors.If
A
is a cell array or a structure, then string arrays in any cell or field ofA
become character vectors or cell arrays of character vectors inB
. All other cells or fields ofA
are unaltered inB
.Otherwise, the function returns
A
unaltered.
[B1,...,Bn] = convertContainedStringsToChars(A1,...,An)
converts
the input arguments A1,...,An
. For every input argument, there must be a
corresponding output argument in B1,...,Bn
.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2018b
See Also
string
| isstring
| convertCharsToStrings
| convertStringsToChars
| isStringScalar
| ischar
| validateattributes