| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
Startup Folder on Windows Platforms Startup Folder on UNIX Platforms |
The startup folder is the current folder in the MATLAB application when it starts. It is convenient if you make the current folder upon startup be a folder that you frequently use. On Windows and Apple Macintosh platforms, a folder called userpath is added automatically to the search path upon startup, and is the default startup folder. On UNIX[1] platforms, you can set the userpath as the startup folder. The default value for userpath is, for example, Documents/MATLAB on Microsoft Windows Vista™ platforms. You can specify a different default value for userpath, or specify a different startup folder.
Accepting the default value for userpath and using it as the startup folder offers these benefits:
You can store the MATLAB files you work with in one, appropriately-named location, such as Documents/MATLAB.
Your MATLAB files are readily available upon startup, because the current folder is always the same, for example, Documents/MATLAB.
You can always run your files because MATLAB automatically adds the userpath folder to the top of the search path upon startup.
The first time you run a new version of MATLAB, MATLAB automatically creates the userpath folder if it does not exist.
When you upgrade to a newer version of MATLAB, MATLAB automatically continues to use the same MATLAB folder and your existing files, with all of its other benefits.
The default userpath also utilizes the benefits provided by the standard location in the Windows and Macintosh environments for storing personal files. Files in the Documents/MATLAB folder (or My Documents/MATLAB on Windows platforms other than Windows Vista) are available to you when you use other machines. Because each user has their own Documents/MATLAB folder, other users, even those using your machine, cannot access files in your Documents/MATLAB folder.
To view the userpath value, run the userpath function. To specify a location other than the default for userpath, or if you do not want to take advantage of userpath, make changes with the userpath function.
There are other ways to change the startup folder as well as the folders on your search path. For more information, see Changing the Startup Folder and Ways to View and Change the Search Path.
The startup folder on Windows platforms depends on any startup options you specified and the way you started MATLAB:
Startup Folder When Starting the MATLAB Program from a Windows Shortcut
Startup Folder When Starting the MATLAB Program from an Associated File
Startup Folder When Starting the MATLAB Program from a DOS Window
When you start the MATLAB program from a Windows shortcut, by default MATLAB sets the startup folder to the userpath value, whose default value is My Documents\MATLAB, or Documents\MATLAB on Windows Vista platforms. The userpath folder is automatically added to the search path.
If there is a value specified in the Start in field of the Properties dialog box for the MATLAB program, that value is the startup folder, although the userpath is added to the search path. If MATLAB does not find a valid userpath value upon startup, and the Start in field is empty, the startup folder is the Windows desktop.
When you start MATLAB by double-clicking a file type associated with MATLAB, that file's folder is the startup folder. The userpath folder is automatically added to the search path.
When you start MATLAB from a DOS window, the startup folder is the folder in which you ran the matlab function. The userpath folder is automatically added to the search path.
On UNIX platforms, the default startup folder is the folder from which you started MATLAB. You can specify that the userpath be the startup folder by setting the value of the environment variable MATLAB_USE_USERPATH to 1 prior to startup. By default, userpath is userhome/Documents/MATLAB, and MATLAB automatically adds the userpath folder to the top of the search path upon startup. To specify a different folder for userpath, and for other options, use the userpath function.
When you start MATLAB on Apple Macintosh platforms by double-clicking the MATLAB application, the startup folder is the value returned when you enter userpath, which by default is userhome/Documents/MATLAB. MATLAB automatically adds the userpath folder to the top of its search path upon startup. To specify a different folder for userpath, and for other options, use the userpath function.
When you start MATLAB in a shell, the startup folder is the same as for other UNIX platforms—see Startup Folder on UNIX Platforms.
You can start MATLAB in a folder other than the default in one of these ways:
Use the userpath function to change the startup folder as well as to add the startup folder to the search path upon startup. For more information, see the userpath reference page and Startup Folder for the MATLAB Program.
To change the startup folder on Windows platforms using the shortcut,
Right-click the shortcut icon for MATLAB and select Properties from the context menu.
The Properties dialog box for MATLAB opens to the Shortcut pane.
The Target field contains the full path to start MATLAB.
By default, the startup folder is My Documents\MATLAB or Documents\MATLAB on Windows Vista platforms; for more information, see Startup Folder on Windows Platforms.
In the Start in field, specify the full path to the folder in which you want MATLAB to start, and click OK.

The next time you start MATLAB using that shortcut icon, the current folder will be the one you specified in step 2.
You can make multiple shortcuts to start MATLAB, each with its own startup folder, and with each startup folder having different startup options.
Use the startup.m file to specify the startup folder as well as other startup options—for details, see Specifying Startup Options Using the Startup File for the MATLAB Program, startup.m.
[1] UNIX is a registered trademark of The Open Group in the United States and other countries.
![]() | Starting the MATLAB Program on Macintosh Platforms | Startup Options | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |