FUNCTION REFERENCE

fileparts

Folder, name and extension parts of a path.

Folder, name and extension parts of a path.

Syntax

folder = fileparts(path); [folder, name, ext] = fileparts(path)

Returns the folder portion of a character path; it is empty if the path has no folder. name is the text after the last separator up to its last dot, ext that dot and what follows.

Example

[folder, name, ext] = fileparts('data/run1.csv')   % 'data', 'run1', '.csv'

Differences from MATLAB: Character row input only.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.