フィルターのクリア

Create several modules in Matlab?

6 ビュー (過去 30 日間)
Ashutosh sRINET
Ashutosh sRINET 2017 年 4 月 11 日
回答済み: Michael Verrett 2020 年 9 月 6 日
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.

回答 (2 件)

Vandana Ravichandran
Vandana Ravichandran 2017 年 4 月 13 日
編集済み: Vandana Ravichandran 2017 年 4 月 13 日
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 件のコメント
Ashutosh sRINET
Ashutosh sRINET 2017 年 4 月 17 日
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

サインインしてコメントする。


Michael Verrett
Michael Verrett 2020 年 9 月 6 日
determine <-31>4,<33>7

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by