addpath

Updates the search path for functions by adding the given directories d, ... to the existing path R.

Syntax

R = addpath (d,...)

R = addpath ('d1; d2; d3; ...')

Inputs

d,...
Directories to be prepended to the search path. The directories must exist. An absolute path is not needed if directories are nested in the currennt directory.
Type: string
'd1; d2; d3; ...'
Multiple directories can be specified in the same string by using a semicolon (;) as the delimiter.
Type: string

Outputs

R
Updated search path for functions.
Type: string.

Example

Prepend directory to the search path:
R = addpath('Functions')
R = Functions;C:/Users/Default/TestScripts;C:/Program Files/Toolboxes
Prepend multiple directories, specified in a single string, to the search path:
R = addpath('Functions;Tests;UserDefined')
R = UserDefined;Tests;Functions;C:/Users/Default/TestScripts;C:/Program Files/Toolboxes

Comments

The given directories, d, ..., are prepended to the existing search path, R. Multiple directories can also be specified in the same input string using the syntax d1; d2; d3; ..., where a semicolon is used as the delimiter for directories. A warning is returned if one or more of the given directories d, ... do not exist.