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

    %% Combine String Array Along Different Dimension
% Combine the strings in |str| along the first dimension. By default, the |join| 
% function combines strings along the last dimension with a size that does not equal one. To 
% combine the strings along the first dimension, specify it as an additional input argument.
str = string({'John','Smith';...
              'Mary','Jones';...
              'Alice','White'})
          
%%
newStr = join(str,1)