How to get and set user path in MatLab? - userpath -- MatLab

 How to get and set user path in MatLab? - userpath -- MatLab


How to get and set user path in MatLab?
[Ans]
userpath

[Description]
look at or change user path.
user path is the folder that user works in currently.

userpath;
Get user path.

userpath(<newPath>);
Set user path as <newPath>.

userpath('reset');
Reset userpath. Set user path as default user path.

userpath('clear');
clear user path immediately.

[NOTE]
Great importance!!! Please pay a lot of attention on it!!!

(1)Default user path is platform-specific.

  • Windows® platforms — %USERPROFILE%/Documents/MATLAB.

  • Mac platforms — $home/Documents/MATLAB.

  • Linux® platforms — $home/Documents/MATLAB if $home/Documents exists.

(2)
After calling userpath('clear'),
userpath('clear') removes the user-specific folder from the search path immediately, and for future MATLAB sessions.

it will effect for future sessions.

(3)
In MATLAB Online™, you only can view the folder specified by userpath. Changing the folder is not supported.

more details on:

Comments

Popular posts from this blog

How to join a file path with multiple char vector or string in MatLab? - fullfile -- MatLab