www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ConcatenateTwoStringArraysExample.m
%% Concatenate Two String Arrays % Starting in R2016b, you can create string arrays with the |string| % function, and concatenate them with the |strcat| function. str1 = string({'John ','Mary '}); str2 = string({'Smith','Jones'}); str = strcat(str1,str2) %% % Concatenate a character vector onto each element of the string array. str = strcat(str,', M.D.') %% % Text processing functions (such as |strfind| and |regexp|) accept string arrays as % inputs, but other functions (for example, |addpath|) do not.