I'm not sure if you are talking about the PATH
system environment variable or the MATLABPATH
environment variable. If you mean the system environment variable, Andrew's answer seems to answer the question. Otherwise, here's some information about the MATLAB variable, in case you meant that:
The MATLABPATH
variable in MATLAB tells MATLAB where to look for functions. It's analogous to the PATH
system environment variable in both Windows and *nix systems (which is what Andrew was describing), but is only for the MATLAB environment.
For example, if you had a script called myScript.m
stored in the C:\Users\me\Documents\MATLAB\
directory that defines the function myScript
, you would be able to use your myScript function regardless of what directory you are currently working in in MATLAB.
You may modify your MATLABPATH
by using the path
, addpath
, genpath
, and other such functions.