FUNCTION REFERENCE

genpath

List a folder and its subfolders as a path string.

List a folder and its subfolders as a path string.

Syntax

p = genpath(folder)

Depth first in sorted name order; each folder is followed by pathsep. Leaves out folders whose names start with @, + or ., and folders named private or resources. A missing folder gives ''. Walks at most 10000 folders; symbolic links to folders are followed once.

Example

d=tempname(tempdir); mkdir(d); p=genpath(d); rmdir(d); strcmp(p, [d pathsep])   % 1

Differences from MATLAB: A relative folder is returned joined to pwd. Subfolder order is sorted by name.

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