Borrar filtros
Borrar filtros

Create several modules in Matlab?

6 visualizaciones (últimos 30 días)
Ashutosh sRINET
Ashutosh sRINET el 11 de Abr. de 2017
Respondida: Michael Verrett el 6 de Sept. de 2020
Is there a way to create modules in Matlab and associate one module with another to create a separation of concern? The modules should be readonly and should be able to compile individually. Like 'Jars' in Java.
For example:
As in subject, we are looking for an option to build Project Dependency Management with MATLAB. There does not seem to be an obvious way out (something like Maven does for Java projects).
This is what we need :
+ Project A • calculate_tax.m
+ Project B • calculate_sal.m
Project B depends on project A where calculate_sal (from B) calls calculate_tax (in A). Both these project A & B have their own life line and dependency should allow to point to specific version.

Respuestas (2)

Vandana Ravichandran
Vandana Ravichandran el 13 de Abr. de 2017
Editada: Vandana Ravichandran el 13 de Abr. de 2017
In MATLAB, we can use packages to make the maintenance and organization of matlab files easier. They help to create a namespace for the specific set of files contained within them.
Packages are special folders that can contain class folders, function, and class definition files, and other packages. Using a package provides means to organize classes and functions. Packages also enable you to reuse the names of classes and functions in different packages.
Package folders always begin with the + character. For example,
+mypack
+mypack/pkfcn.m % a package function
+mypack/@myClass % class folder in a package
Refer the following page from the documentation for more details on Packages:
  1 comentario
Ashutosh sRINET
Ashutosh sRINET el 17 de Abr. de 2017
Thanks for the answer Vandana.
Actually we are looking for something which can package a project in such a way that it can be used during compilation and at runtime but should be readonly. For e.g. it should be just like a toolbox but for a single project and not for the entire instance of matlab.
I am aware of the packages and we use them extensively but they donot help the cause.
Regards, Ashutosh

Iniciar sesión para comentar.


Michael Verrett
Michael Verrett el 6 de Sept. de 2020
determine <-31>4,<33>7

Categorías

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

Community Treasure Hunt

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

Start Hunting!

Translated by