Use the following function: http://www.mathworks.com/help/matlab/ref/cellstr.html
>> B = cellstr(A)
B =
'APR'
'MAY'
>> B{1}
ans =
APR
Answer from Franck Dernoncourt on Stack Overflowhow to convert a character into string
convert Char to string type
How to convert char into string?
Converting a char array to string using MATLAB - Stack Overflow
Videos
Use the following function: http://www.mathworks.com/help/matlab/ref/cellstr.html
>> B = cellstr(A)
B =
'APR'
'MAY'
>> B{1}
ans =
APR
For a 3D char array T
B = cellstr(T(1,:,:))
Gives the error
Error using cellstr (line 23)
S must be 2-D.
Instead assign it to a 2D matrix first, then use 'cellstr' as Franck suggested above.
A(:,:) = T(1,:,:)
B = cellstr(A)
I have that the two methods are used in parallel. The built-in functions want the 'char' arguments. Most users just simply use "str" and 'char' randomly. The worst part is that when I write a utility function I must support both. The real pain is checking is one of them is empty.
isempty('') does not yield the same result as isempty("")
This thing just makes me wonder, what's the point in introducing a dedicated stirng type after many many years?
Strings were not a thing before 2016b! Yes, strings were added in 2016, why?