MATLAB Application won't close

43 次查看(过去 30 天)
Bryan aguilar
Bryan aguilar 2025-6-25
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 个评论
Walter Roberson
Walter Roberson 2025-6-25
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
Vidhi Agarwal 2025-6-30
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!

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Search Path 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by