Home

How to Temporarily Change the Current Folder in MATLAB

|
|  Updated:  
2016-03-27 09:31:32
|   From The Book:  
MATLAB For Dummies
Explore Book
Buy On Amazon

When you first start MATLAB, the current folder always defaults to the MATLAB folder found in your user folder for the platform of your choice. For Windows users, that means the C:UsersUser Name>DocumentsMATLAB folder. Burying your data way down deep in the operating system may seem like a good idea to the operating system vendor, but you can change the current folder location to something more convenient when desired.

Perhaps your data is actually stored on a network drive, you want to use a shared location so that others can see your data, or you simply want to use a more convenient location on your local drive. The following steps help you change the current folder:

Click Set Path in the Environment group on the Toolstrip’s Home tab.

Click Set Path in the Environment group on the Toolstrip’s Home tab.

You see the Set Path dialog box.

This dialog box lists all the places the MATLAB searches for data, with the default location listed first. You can use these techniques to work with existing folders (go to Step 3 when you’re finished):

To set an existing folder as the default folder, highlight the folder in the list and click Move to Top.

To stop using an existing folder, highlight the folder in the list and click Remove.

Click Add Folder.

Click Add Folder.

You see the Add Folder to Path dialog box.

This dialog box lets you choose an existing folder that doesn’t appear in the current list or add a new folder to use:

To use a folder that exists on your hard drive, use the dialog box’s tree structure to navigate to the folder, highlight its entry, and then click Select Folder.

To create a new folder, highlight the parent folder in the dialog box’s tree structure, click New Folder, type the name of the folder, press Enter, and then click Select Folder.

Click Save.

MATLAB makes the folder you select the new default folder. (You may see a User Account Control dialog box when working with Windows; click Yes to allow Windows to perform the task.)

Click Close.

The Set Path dialog box closes.

Type the new location in the Address field.

The Current Folder display changes to show the new location.

About This Article

This article is from the book: 

About the book author:

John Paul Mueller is a freelance author and technical editor. He has writing in his blood, having produced 100 books and more than 600 articles to date. The topics range from networking to home security and from database management to heads-down programming. John has provided technical services to both Data Based Advisor and Coast Compute magazines.

Jim Sizemore is Professor of Physics and Engineering at Tyler Junior College. For over 25 years he s worked in the semiconductor and software industries as a process engineer, device physicist, and software developer and has been teaching college physics, engineering, and math for the last 13 years.