fileparts
Returns the path, filename and extension of a file path.
📝Syntax
[p, f, e] = fileparts(fullpath)
p = fileparts(fullpath, 'path')
f = fileparts(fullpath, 'filename')
e = fileparts(fullpath, 'extension')
📥Input Arguments
Parameter Description
fullpath a string: file or directory name.
📤Output Arguments
Parameter Description
p a string: path of the directory fullpath.
f a string: file name without extension of fullpath.
e a string: extension name of fullpath.
📄Description

[p ,f, e] = fileparts(fullpath) splits in its three parts: path, filename, extension including the dot.

💡Examples
[p, f, e] = fileparts([nelsonroot(), '/etc/finish.m'])
p = fileparts([nelsonroot(), '/etc/finish.m'], 'path')
f = fileparts([nelsonroot(), '/etc/finish.m'], 'filename')
e = fileparts([nelsonroot(), '/etc/finish.m'], 'extension')
🔗See Also
isdirisfilepathsepfilesep
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub