MATLAB超类不能在MATLAB的搜索路径上找到

MATLAB超类不能在MATLAB的搜索路径上找到

问题描述:

我有两个路径:


  • C:\controller\functions\verifyModel.m

  • C:\OGVD\prod\KMLP\controller\controllerStatus.m / li>
  • C:\controller\functions\verifyModel.m
  • C:\OGVD\prod\KMLP\controller\controllerStatus.m
classdef verifyModel 
    methods(access=public)
        function...
    end
end

$ b b

controllerStatus.m



controllerStatus.m

classdef controllerStatus < verifyModel     
   .....
end

但是当我运行 controllerStatus.m ,我得到一个错误,因为我使用的类不在路径
如何添加 verifyModel 到路径?

but when I run controllerStatus.m, I got an error as the class I used isn't in the path how could I add verifyModel to the path ?

在使用controllerStatus之前:

Before usage of controllerStatus use:

addpath('C:\controller\functions\')

此外,您可能需要插入 @ folder 。这些文件夹在可见时添加到路径,因为它们是您当前路径( pwd )的子文件夹。

Also, you might want to put in in a @ folder. These folders are added to the path whenever they are visible, so as they are a subfolder of your current path(pwd).

或将'C:\controller\functions \'添加到您的静态matlab路径,我不推荐。

Or add 'C:\controller\functions\' to your static matlab path, what I do not recommend.

=http://stackoverflow.com/questions/9781866/folder-and-foldertitle =so>此答案。

See also this answer.