How to store .m files within a package folder

4 visualizaciones (últimos 30 días)
TADA
TADA el 24 de Oct. de 2018
Comentada: David Saidman el 4 de Abr. de 2019
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?

Respuesta aceptada

Philip Borghesani
Philip Borghesani el 25 de Oct. de 2018
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 comentarios
TADA
TADA el 25 de Oct. de 2018
Neat workaround, thanks!
David Saidman
David Saidman el 4 de Abr. de 2019
thats really clever, thanks. itll do

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by