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

    %% Escape Characters in String Array
% Create a string array that includes escape-character sequences to specify
% horizontal tabs. Use the |compose| function to translate the |\t|
% escape characters.
str = string({'Name\tDate of Birth\tLocation';...
    'Jones\t10/20/2015\tUK';...
    'Simpson\t09/12/2015\tUSA'});
newStr = compose(str)

%%
% Prevent translation of |\n| using another |\| character.
str = string('Don''t escape the second\n\\n escaped-character sequence.');
newStr = compose(str)