问题
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