MATLAB Answers

How to store .m files within a package folder

조회 수: 7(최근 30일)
TADA
TADA 2018년 10월 24일
댓글: David Saidman 2019년 4월 4일
I want to store my files within a package.
I have ~30 classes in this package and would like to organize them in sub-folders logically.
The thing is I want them to be public, but I don't want to make the sub-folder a package because i'd like to avoid the nested namespaces in this situation if possible.
as far as I can see the documentation only describes nesting private folders and +package folders/@class folders.
is it possible to have nested folders within a package with public functions?

채택된 답변

Philip Borghesani
Philip Borghesani 2018년 10월 25일
Not the way you are thinking of it however you can organize it this way:
myCommonStuff/+mypackage %basic stuff
myAddOnStuff/+mypackage %extra stuff that I want to keep separate
Now add both myCommonStuff and myAddOnStuff to the MATLAB path and all functions or classes will appear in mypackage. Classes in myAddOnStuff are free to inherit from those in myCommonStuff.
  댓글 수: 2
David Saidman
David Saidman 2019년 4월 4일
thats really clever, thanks. itll do

댓글을 달려면 로그인하십시오.

추가 답변(0개)

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by