我有两条路:
C:\controller\functions\verifyModel.m
C:\OGVD\prod\KMLP\controller\controllerStatus.m
验证模型.m
classdef verifyModel
methods(access=public)
function...
end
end
控制器状态.m
classdef controllerStatus < verifyModel
.....
end
但当我跑步时controllerStatus.m
,我收到错误,因为我使用的类不在路径中
我怎样才能添加verifyModel
到路径?
在使用controllerStatus之前使用:
addpath('C:\controller\functions\')
另外,您可能想放入@ folder http://www.mathworks.nl/help/matlab/matlab_oop/organizing-classes-in-folders.html。这些文件夹只要可见就会添加到路径中,因此它们是当前路径的子文件夹(pwd
).
或者将“C:\controller\functions\”添加到静态 matlab 路径中,我不推荐这样做。
也可以看看这个答案 https://stackoverflow.com/questions/9781866/folder-and-folder.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)