Sometimes when I add a new file to my path, I have to restart MATLAB or it won't be detected. There must be an other way to this!
oldFolder = cd( newFolder ) returns the existing current folder to oldFolder , and then it changes the current folder to newFolder .
Absolute and Relative Path Names MATLAB always accepts absolute path names (also called full path names), such as I:/Documents/My_Files or /users/myuserid/Homework/myfile. m . An absolute path name can start with any of the following: UNC path '\\' .
To open the Set Path dialog box, on the Home tab, in the Environment section, click Set Path. You can also use the addpath function to add multiple folders to the search path.
I have experienced similar problems (Matlab does not notice it when I change a file). Unfortunately, I have no idea what causes it or how to solve it. I usually find that CLEAR ALL
solves the problem, but be aware that it clears all variables in the work space. Some 'REHASH' command (e.g., REHASH TOOLBOXRESET
) may also be useful.
I'd love to see a better answer; all documentation that I came across seems to indicate that this cannot happen.
Perhaps this is a problem with Matlab caching certain files at startup to improve performance. This happens with files in certain directories.
From Matlab help for path command:
Note (...) Also note that locations of files in the matlabroot/toolbox directory tree are loaded and cached in memory at the beginning of each MATLAB session to improve performance. If you save files to matlabroot/toolbox directories using an external editor or add or remove files from these directories using file system operations, run rehash toolbox before you use the files in the current session. If you make changes to existing files in matlabroot/toolbox directories using an external editor, run clear functionname before you use the files in the current session. For more information, see the rehash reference page or the Toolbox Path Caching topic in the MATLAB Desktop Tools and Development Environment documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With