www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CreateStringArrayFromCellArrayExample.m

    %% Convert Cell Array to String Array
% Convert a cell array of character vectors to a string array.
A = {'Mercury','Gemini','Apollo';...
     'Skylab','Skylab B','ISS'}
 
%%
str = string(A)

%% 
% Access the second element in the first row of |str| by indexing with smooth 
% parentheses. You can access strings in a string array with matrix indexing,
% just as you would access elements of a numeric array.
str(1,2)

%%
% Access the third column.
str(:,3)