MATLAB Function Reference | ![]() ![]() |
Syntax
[path,name,ext,ver] = fileparts('filename'
)
Description
[path,name,ext,ver] = fileparts('
returns the path, filename, extension, and version for the specified file. The returned filename'
)
ext
field contains a dot (.
) before the file extension.
The fileparts
function is platform dependent.
You can reconstruct the file from the parts using
fullfile(path,[name ext ver])
Examples
This example returns the parts of file
to path
, name
, ext
, and ver
.
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 | ![]() |