将MATLAB char数组转换为字符串

rwo*_*lst 10 string matlab char

从MATLAB char数组开始,A:

A(1,1) = 'A'
A(1,2) = 'P'
A(1,3) = 'R'
A(2,1) = 'M'
A(2,2) = 'A'
A(2,3) = 'Y'
Run Code Online (Sandbox Code Playgroud)

如何将其转换为字符串B的单元格,以便:

B{1} = 'APR'
B{2} = 'MAY'
Run Code Online (Sandbox Code Playgroud)

编辑:A是一个单元格,使用函数cellstr给出错误

Error using cellstr (line 23)
S must be 2-D. 
Run Code Online (Sandbox Code Playgroud)

Fra*_*urt 9

使用以下功能:http://www.mathworks.com/help/matlab/ref/cellstr.html

>> B =  cellstr(A)

B = 

    'APR'
    'MAY'

>> B{1}

ans =

APR
Run Code Online (Sandbox Code Playgroud)