MATLAB: How to access other classes in the same package folder from inside

accessclassinheritMATLABnamespaceooppackagepackage folder

I created a package folder (like "+mypackage") under the MATLAB folder with several classes in the package, and I would like to let one class to inherit another (all in the same package, same folder), e.g.
./MATLAB/+mypackage/A.m with first line "classdef A"
./MATLAB/+mypackage/B.m with first line "classdef B < A"
However, I get following error when I want to create an instance of B:
The specified superclass 'A' contains a parse error, cannot be found on MATLAB's searchpath, or is shadowed by another file with the same name.
I know that if I want to access these classes from outside of the outside of the package, I should use a syntax like "mypackage.A". Should I use the same syntax from inside of the package? Where did I do wrong?

Best Answer

In my opinion, matlab's packages are not well designed as, indeed, function and classes within the package still have to specify the package name when calling other function or classes in the same package.
So indeed, you have to use:
classdef B < mypackage.A
Hilarity ensues when you want to rename the package.