| MATLAB Function Reference | ![]() |
Build full filename from parts
表示
fullfile('dir1','dir2',...,'filename')
f = fullfile('dir1','dir2',...,'filename')
詳細
fullfile(dir1,dir2,...,filename)
ディレクトリや指定したファイル名からフルファイル名を組み立てます。これは、概念的には、ディレクトリセパレータと共にデレクトリが始まっているか、または、終了しているかを取り扱う場合に注意することを除いて
f = [dir1 dirsep dir2 dirsep ... dirsep filename]
例題
f = fullfile('C:','Applications','matlab','myfun.m')
f =
C:\Applications\matlab\myfun.m
つぎの二つは、UNIX での結果と同じですが、2番目のもののみ、すべてのプラットフォームで機能します。
fullfile(matlabroot,'toolbox/matlab/general/Contents.m') と
fullfile(matlabroot,'toolbox','matlab','general','Contents.m')
| full | func2str | ![]() |