MATLAB Application won't close
43 views (last 30 days)
Show older comments
I am trying to close down MATLAB R2022b but as will give the error below in the command window. This has not happened before and now the only way to close down the app is through task manager. I have located the finish.m file in my directory which seems fine. Not sure if this is a onedrive issue either as this morning i tried syncing some new onedrive files, but I'm unsure how to fix this.
Warning: "C:\Users\Bryan\OneDrive - Knights - University of Central Florida\Documents\MATLAB" not found in path.
> In rmpath (line 71)
In finish (line 51)
Index in position 1 exceeds array bounds. Index must not exceed 1.
Error in finish (line 74)
path(path, wup);
>>
2 Comments
Walter Roberson
on 25 Jun 2025
It sounds as if at the point with the problem, path has somehow become a variable. finish is probably a script rather than a function, and scripts are executed in the same context as the invoking function... in the case of exiting the code, the context is probably the base workspace. So you probably have a variable named path in your base workspace.
Vidhi Agarwal
on 30 Jun 2025
Following are the steps that can help you to resolve the issue:
- Before closing MATLAB run following command and then try closing MATLAB normally.
clear path
- Check the Base workspace for a "path" variable, by the following command:
whos path
- Try cleaning up the MATLAB path, using the given below commands:
restoredefaultpath
rehash toolboxcache
savepath
Try avoiding to use variable names that shadow important MATLAB functions: path, sum, mean, etc.
Hope this helps!
Answers (0)
See Also
Categories
Find more on Search Path in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!