Folders Structure in OOP in matlab
Show older comments
Hi,
I would like to ask you if it is possible to have a structure in matlab like the one below
mainpath/@fld1
mainpath/@fld1/fld1.m
mainpath/@fld1/@subfld11
mainpath/@fld1/@subfld11/subfld11.m
mainpath/@fld1/@subfld12/
mainpath/@fld1/@subfld12/subfld12.m
mainpath/@fld1/@subfld13/
mainpath/@fld1/@subfld13/subfld13.m
...
What I would like is to organize my code in such a way so that I could understand that subfld11 is part of fld1 (not subclass) and that fld1 (class) can use subfld11 methods/properties etc.
Thanks in advance
2 Comments
Walter Roberson
on 10 Oct 2011
Hmmmm, maybe, but the '@' folder structure was the old style of OOP; you have more control with the newer style (which has been around since roughly 2009a I think it was.)
Simeon
on 11 Oct 2011
Accepted Answer
More Answers (1)
Daniel Shub
on 10 Oct 2011
0 votes
You cannot do that. From the documentation ( http://www.mathworks.co.uk/help/techdoc/matlab_oop/brfynrp-1.html):
@-folders — Folder name begins with "@" and is not on the MATLAB path, but its parent folder is on the path.
So your second level of @ folders would not have parents who are on the path.
You might want to look into a package:
Categories
Find more on Search Path in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!