Generate search path
p = genpath returns a character vector containing a search path that
includes all the folders and subfolders below
p = genpath( returns a character vector
containing a search path that includes
folderName and multiple
levels of subfolders below
not include folders named
private, folders that begin with the
@ character (class folders), folders that begin with the
+ character (package folders), folders named
resources, or subfolders within any of these.
Add Folder and Subfolders to Search Path
genpath in conjunction with
addpath to add a folder and its subfolders to the search path.
Create a folder
myfolder containing a subfolder
mkdir myfolder; cd myfolder; mkdir mysubfolder; cd ..
Generate a path that includes
myfolder and all folders below it.
p = genpath('myfolder')
p = 'myfolder:myfolder/mysubfolder:'
Add the folder and its subfolders to the search path.
folderName — Folder name
character vector | string scalar
Folder name, specified as a character vector or string scalar.
Introduced before R2006a