Startup Folder for the MATLAB Program

April 13th, 2010 Posted in Documents

What Is the Startup Folder?

The startup folder is the current folder in the 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 is added automatically to the search path upon startup, and is the default startup folder. On UNIX[1] platforms, you can set the as the startup folder. The default value for is, for example, Documents/ on Microsoft Windows Vistaâ„¢ platforms. You can specify a different default value for , or specify a different startup folder.

Accepting the default value for and using it as the startup folder offers these benefits:

  • You can store the files you work with in one, appropriately-named location, such as Documents/.
  • Your files are readily available upon startup, because the current folder is always the same, for example, Documents/.
  • You can always run your files because automatically adds the folder to the top of the search path upon startup.
  • The first time you run a new version of , automatically creates the folder if it does not exist.
  • When you upgrade to a newer version of , automatically continues to use the same folder and your existing files, with all of its other benefits.
  • The default also utilizes the benefits provided by the standard location in the Windows and Macintosh environments for storing personal files. Files in the Documents/ folder (or My Documents/ on Windows platforms other than Windows Vista) are available to you when you use other machines. Because each user has their own Documents/ folder, other users, even those using your machine, cannot access files in your Documents/ folder.

To view the value, run the function. To specify a location other than the default for , or if you do not want to take advantage of , make changes with the 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 .

The depends on any startup options you specified and the way you started :

  • Startup Folder When Starting the Program from a Windows Shortcut
  • Startup Folder When Starting the Program from an Associated File
  • Startup Folder When Starting the Program from a DOS Window

Startup Folder When Starting the Program from a Windows Shortcut

When you start the program from a Windows shortcut, by default sets the startup folder to the value, whose default value is My Documents\, or Documents\ on Windows Vista platforms. The 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 program, that value is the startup folder, although the is added to the search path. If does not find a valid value upon startup, and the Start in field is empty, the startup folder is the Windows desktop.

Startup Folder When Starting the Program from an Associated File

When you start by double-clicking a file type associated with , that file’s folder is the startup folder. The folder is automatically added to the search path.

Startup Folder When Starting the Program from an Associated File

When you start from a DOS window, the startup folder is the folder in which you ran the function. The folder is automatically added to the search path.

Startup Folder on UNIX Platforms

On UNIX platforms, the default startup folder is the folder from which you started . You can specify that the be the startup folder by setting the value of the environment variable MATLAB_USE_USERPATH to 1 prior to startup. By default, is userhome/Documents/, and automatically adds the folder to the top of the search path upon startup. To specify a different folder for , and for other options, use the function.

Startup Folder on Macintosh Platforms

When you start on Apple Macintosh platforms by double-clicking the application, the startup folder is the value returned when you enter , which by default is userhome/Documents/. automatically adds the folder to the top of its search path upon startup. To specify a different folder for , and for other options, use the function.

When you start in a shell, the startup folder is the same as for other UNIX platforms—see Startup Folder on UNIX Platforms.

Changing the Startup Folder

You can start in a folder other than the default in one of these ways:

Changing the Startup Folder Via the Function

Use the 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 reference page and Startup Folder for the Program.

Changing the Startup Folder Using the Shortcut — Windows Platforms Only

To change the using the shortcut,

  1. Right-click the shortcut icon for and select Properties from the context menu.
  2. The Properties dialog box for opens to the Shortcut pane.

  3. The Target field contains the full path to start .

By default, the startup folder is My Documents\ or Documents\ on Windows Vista platforms; for more information, see .

In the Start in field, specify the full path to the folder in which you want to start, and click OK.

The next time you start using that shortcut icon, the current folder will be the one you specified in step 2.

You can make multiple shortcuts to start , 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 Program, startup.m.

[1] UNIX is a registered trademark of The Open Group in the United States and other countries.

Related posts

Leave a Reply

You must be logged in to post a comment.