This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Start up function for user-defined options




startup executes commands of your choosing when the MATLAB® program starts.

Create a startup file in the userpath folder, which is on the MATLAB search path. Add commands you want executed at startup. For example, your startup function might include physical constants, defaults for graphics properties, engineering conversion factors, or anything else you want predefined in your workspace.


  • To specify the current folder in MATLAB when it starts, set the Initial working folder preference, described in General Preferences.


At startup, MATLAB automatically executes the matlabrc function and, if it exists on the MATLAB search path, startup. The matlabrc file, which is in the matlabroot/toolbox/local folder, is reserved for use by MathWorks® and by system administrators on multiuser systems.

Was this topic helpful?