MATLAB字符串分解, 合并

% 分解
% regexp
s = 'ab/c/d.png'
file_name = regexp(s, '/', 'split');    % 'd.png'
% split
fractions = split('a0_b1_c2', '_');
b1 = fractions{2};    % 'b1'

% 拼接
% strcat
s = strcat('a', 'b');    % 'ab'
% []
best_band_ever = ['TheSt', 'oneRoses'];    % 'TheStoneRoses'

% 路径拼接
s = fullfile('a', 'b');    % 'a\b'

原文地址:https://www.cnblogs.com/ZhengPeng7/p/8476837.html