The MATLAB installation directory can be found by executing the following in the MATLAB command prompt:
matlabroot
Starting from MATLAB 7.7 (R2008b), MATLAB default installation directory on the MAC OS is
/Applications/MATLAB_<Release>.app
where <Release> is the MATLAB Release’s version, i.e., R2008b, R2009a, etc.
The contents of the .app directory cannot be accessed by browsing through the ‘Set Path’ GUI in the File menu. To add the directories under .app directory to the path, use ADDPATH and SETPATH commands. For more information on the ADDPATH and SETPATH commands, please refer to the documentation by executing the following in the MATLAB command prompt:
help addpath
help setpath
You may need more information:
addpath Description
addpath(‘folderName1′,’folderName2′,’folderName3’ …) adds the specified folders to the top of the search path. Use the full path name for each folder. Use genpath with addpath to add all subfolders of folderName. Use addpath statements in a startup.m file to modify the search path programmatically at startup.
- addpath(‘folderName1′,’folderName2′,’folderName3’ … flag) adds the specified folders to either the top or bottom of the search path, or disables folder change detection on Windows, depending on the value of position.
- previous_path = addpath(…) configures the path using the inputs and returns the previous path setting.
startup Description
startup executes commands of your choosing when the MATLAB program starts.
Create a startup.m file in your MATLAB startup folder and put in the file any commands you want executed at MATLAB startup. For example, your startup.m file might include physical constants, defaults for Handle Graphics properties, engineering conversion factors, or anything else you want predefined in your workspace.
userpath Description
userpath returns a string specifying the user portion of the search path. The user portion of the search path is the first folder on the search path, above the folders supplied by MathWorks. The default folder is Documents/MATLAB on all platforms except Windows platforms released before Windows Vista™—for those Windows platforms, the default is My Documents/MATLAB. By default, the userpath folder is the current folder when you start up MATLAB — that is, it is the default startup folder. For information on specifying a different folder for the startup folder, see Startup Folder for the MATLAB Program. On Macintosh and UNIX platforms, you can automatically add additional subfolders to the top of the search path upon startup by specifying the path for the subfolders via the MATLABPATH environment variable.
- userpath(‘newpath’) sets the userpath value to newpath. The newpath folder appears at the top of the search path immediately and at startup in future sessions. MATLAB removes the folder previously specified by userpath from the search path. newpath must be an absolute path.
- userpath(‘reset’) sets the userpath value to the default for that platform, creating the Documents/MATLAB (or My Documents/MATLAB) folder, if it does not exist. MATLAB immediately adds the default folder to the top of the search path, and also adds it to the search path at startup in future sessions.
- userpath(‘clear’) clears the value for userpath. MATLAB removes the folder previously specified by userpath from the search path.
Hey! I simply wish to give a huge thumbs up for the good information you have got right here on this post. I will likely be coming back to your blog for extra soon.
Your weblog is outrageous! I mean, Ive never been so entertained by anything in my life! Your vids are excellent for this. I mean, how did you manage to discover some thing that matches your style of writing so nicely? Im truly pleased I started reading this these days. Youve got a follower in me for positive!
Hi, Thanks a lot for this fantastic posting! I will certainly bookmark this website. Many thanks.