Development Environment | ![]() ![]() |
You can define startup options for MATLAB, which instruct MATLAB to perform certain operations upon startup. There are two ways to specify startup options for MATLAB:
Using the Startup File for MATLAB, startup.m
At startup, MATLAB automatically executes the master M-file matlabrc.m
and, if it exists, startup.m
. The file matlabrc.m
, which lives in the local
directory, is reserved for use by The MathWorks, and on multiuser systems, by your system manager.
The file startup.m
is for you to use to specify startup options. You can modify the default search path, predefine variables in your workspace, or define Handle Graphics® defaults. For example, creating a startup.m
file with the line
addpath \home\me\mytools cd \home\me\mytools
adds \home\me\mytools
to your default search path and makes that directory the current directory upon startup.
On Windows platforms, place the startup.m
file in $matlabroot\toolbox\local
, where $matlabroot
is the directory in which MATLAB is installed.
On UNIX workstations, place the startup.m
file in the directory named matlab
off of your home directory, for example, ~/matlab
.
![]() | Startup Directory for MATLAB | Adding Startup Options for Windows Platforms | ![]() |