用法实例
路径到文件
fullfile(matlabroot,'toolbox','matlab','general','Contents.m')
ans =
D:\Program Files\MATLAB\R2014a\toolbox\matlab\general\Contents.m
>> fullfile(toolboxdir('matlab'),'iofun',{'filesep.m';'fullfile.m'})
ans =
'D:\Program Files\MATLAB\R2014a\toolbox\matlab\iofun\filesep.m'
'D:\Program Files\MATLAB\R2014a\toolbox\matlab\iofun\fullfile.m'
路径到文件夹
fullfile(matlabroot,'toolbox','matlab',filesep)
ans =
D:\Program Files\MATLAB\R2014a\toolbox\matlab\