MATLAB : import package for base class

喜你入骨 提交于 2020-01-13 11:03:37

问题


i have a base class A and a derived class B which are stored in the following folder structures.

+myPackage (package Path)
  @A    ( folder of class A )
    A.m ( filename of class )
  @B
    B.m

Now i want to use class B which has the following head

classdef B < A

unfortunately this does not work because they are in different folders and i cannot import like this:

import myPackage.*
classdef B < A

Is it possible to solve this without loosing the folder organisation?


回答1:


I think if you write

classdef B < mypackage.A

it should work.



来源:https://stackoverflow.com/questions/8475312/matlab-import-package-for-base-class

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!