MATLAB Answers

TADA
0

How to store .m files within a package folder

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?

  0 件のコメント

サインイン to comment.

タグ

製品

1 件の回答

回答者: 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 件のコメント

TADA
2018 年 10 月 25 日
Neat workaround, thanks!
David Saidman 2019 年 4 月 4 日
thats really clever, thanks. itll do

サインイン to comment.



Translated by