MATLAB Function Reference |
回傳檔案的部分片段(Return filename parts)
Syntax
[path,name,ext,ver] = fileparts('filename'
)
Description
[path,name,ext,ver] = fileparts('
回傳指定檔案的路徑、檔名、延伸檔名和版本。而 filename'
)
ext
欄位中,延伸檔名包括點 (.
)。
fileparts
函式不是每個作業系統平台都支援(function is platform dependent)。
你可以用下列指令和檔案的部分片段來重新建構完整的檔案名稱。(You can reconstruct the file from the parts using)
fullfile(path,[name ext ver])
Examples
file = '\home\user4\matlab\classpath.txt'; [path,name,ext,ver] = fileparts(file) path = \home\user4\matlab name = classpath ext = .txt ver = ''
See Also
filebrowser | fill |