| MATLAB Function Reference | ![]() |
Syntax
Description
[pathstr,name,ext,versn] = 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
Examples
This example returns the parts of file to path, name, ext, and ver.
file = '\home\user4\matlab\classpath.txt'; [pathstr,name,ext,versn] = fileparts(file) pathstr = \home\user4\matlab name = classpath ext = .txt versn = ''
See Also
| file formats | filesep | ![]() |