MATLAB: Can I use @subClass folder inside @superClass folders to create a class hierarchy

class foldersclass hierarchyclassdefhierarchyoopsubclasssuperclass

I am working on creating a large set of classes in matlab, and the super-class/sub-class setup looks like it will be best. I also have been extensively using the @class folder setup in order to help keep the code set organized. I have several questions which I will ask in another post, but my main question here is whether I can put the @subClass folder inside of the @superClass folder. I really want to create a folder hierarchy of classes and their sub-classes and sub-sub-classes. I have tried this, and both folders look like they are in my matlab path (solid color in the directory panel).
However, I have not been able to call the sub-class constructor, nor its methods. Either
(a) the sub-class is not actually in the matlab path and I really do have to have all of the sub-classes and sub-sub-classes in their own @class directory in the direct matlab path (so, no hierarchy is possible and I should just forget this idea) or
(b) I need some additional way of calling the sub-class constructor and its associated methods. Would I need to add an associated method line to the superClass classdef? I have tried playing a few games with this, and reading the documentation, but I haven't gotten anything working.
Thanks, -Dan

Best Answer

No, you cannot nest @-folders this way. As described in the documentation on class folders an @-folder must not be placed in the MATLAB path while its parent folder must be placed in the path. The arrangement you describe would violate these rules.