Saving my path for future sessions.

Answers (1)

The trick here is to use the help, because it teaches you what to use, at least it gives you a hint at how to solve it. If you managed to create a path, then you would have read the help for a tool like addpath, or even pathtool. HAD you read the help for addpath, at the bottom of the help, you would see a see also line. It reads:
See also genpath, path, pathsep, rmpath, savepath
Next, you might look at the names of those functions, and wonder what savepath does. The name is, at least to me, one that indicates its purpose, i.e., it saves your path so that the next time you enter MATLAB the path will be what you created before. It will remember that path as you saved it.
So always remember to look at the see also line. It is there for a very good reason.
help addpath
addpath - Add folders to search path Syntax addpath(folderName1,...,folderNameN) addpath(folderName1,...,folderNameN,position) addpath(___,'-frozen') oldpath = addpath(___) Input Arguments folderName1,...,folderNameN - Folder names to add to search path character vectors | string scalars position - Position on search path '-begin' (default) | '-end' Output Arguments oldpath - Path prior to addition of folders character vector Examples openExample('matlab/AddFoldertoTopofSearchPathExample') openExample('matlab/AddFoldertoEndofSearchPathExample') openExample('matlab/AddFolderandItsSubfolderstoSearchPathExample') openExample('matlab/AddFoldertoSearchPathandDisableFolderChangeNotificationExample') See also genpath, path, pathsep, rmpath, savepath Introduced in MATLAB before R2006a Documentation for addpath doc addpath
help savepath
savepath - Save current search path Syntax savepath savepath folderName/pathdef.m status = savepath(___) Input Arguments folderName - Folder name string array | character vector Examples web /MATLAB/help/matlab/ref/savepath.html#buofh7k-2_1 See also addpath, rmpath, path, userpath, finish Introduced in MATLAB before R2006a Documentation for savepath doc savepath

Categories

Products

Release

R2024b

Tags

Asked:

about 22 hours ago

Edited:

about 16 hours ago

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!