📄 concatpath.m
字号:
function str = concatpath(varargin)
%CONCATPATH Concatenate file parts with correct file separator.
% STR = CONCATPATH(STR1, STR2, ...) concatenates file/path parts with the
% system file separator.
%
% Example:
% drive = 'C:';
% fileName = 'test.txt';
% fullFileName = concatpath(drive, 'My documents', fileName);
%
% Markus Buehren
% Last modified 05.04.2009
%
% See also FULLFILE, FILESEP, CHOMPSEP.
str = '';
for n=1:nargin
curStr = varargin{n};
str = fullfile(str, chompsep(curStr));
end
if ispc
str = strrep(str, '/', '\');
else
str = strrep(str, '\', '/');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -