Wednesday, August 10, 2011

MATLAB Error: “Name is nonexistent or not a directory”

You can add additional default paths to MATLAB using the “Set Path…” option under the File pull-down menu. This way, you can put utilities (your own .m files) you have written all in one place and have MATLAB access run them by just typing the script like – just as if they are in the current directory.

image

However, if you delete a file directory referenced by these paths – MATLAB will give you an error, but *not* allow you to delete it through the “Set Path…” dialog box. But when you start MATLAB, it will always give you the following error message:

Warning: Name is nonexistent or not a directory:

To delete the path, run “edit pathdef.m” and delete the reference to the deleted path. MATLAB checks this file when it starts and setup all the paths that it should check if it does not find the .m file in the current directly.

Reference: Why do I receive the warning message "Warning: Name is nonexistent or not a directory: .... " when I start MATLAB? [MATLAB & Simulink]