【问题标题】:How to reset @class folder to native state如何将@class 文件夹重置为本机状态
【发布时间】:2016-01-05 05:35:12
【问题描述】:

我无意中弄乱了我的matlabroot 文件夹,现在一些功能被破坏了。如何重置文件夹的状态以使一切恢复正常?

在尝试解决这个question 时,我在@table 文件夹([matlabroot,'\toolbox\matlab\datatypes\@table\*']) 中添加了一个新方法(nansubset.m)。那没有用,所以我删除了它并将其移动到我的 Matlab 路径,正如@TroyHaskin 的回答所建议的那样。一切正常,直到我重新启动 Matlab。现在我收到错误消息:

Error using table/nansubset
Previously accessible file "C:\Program
Files\MATLAB\R2015b\toolbox\matlab\datatypes\@table\nansubset.m" is now inaccessible.

我尝试了clear classesclear java 并重新启动Matlab,但无济于事。

编辑: 我还在 Mathworks 网站上找到了this link,这让我找到了doc toolbox_path_cache,这反过来又建议使用rehash toolboxcache。我这样做了,现在有一个新的错误消息:

Error using table/nansubset
Method 'nansubset' is not defined for class 'table' or is removed from MATLAB's search path.

但是,which nansubset 从我的 Matlab 路径上的目录返回正确的文件。

【问题讨论】:

    标签: matlab oop


    【解决方案1】:

    我已经解决了我的问题。从本质上讲,按照here 的说明,我们被引导到toolbox_path_cachehelpfile,它指出:

    当您在 matlabroot/toolbox 文件夹中添加或删除文件时 其他方式,MATLAB 可能无法识别这些更改。

    ...

    更新缓存,以便 MATLAB 识别 您在 matlabroot/toolbox 文件夹中所做的更改。

    要更新缓存,请键入 rehash toolboxrehash toolboxcache。在此之后,需要重新启动 Matlab 才能解决问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      • 2011-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多