Calling a MATLAB Application file from a terminal

11 ビュー (過去 30 日間)
Luke Lawrence
Luke Lawrence 2020 年 11 月 21 日
コメント済み: Mario Malic 2020 年 11 月 22 日
Hi all,
I would like to call a MATLAB application file, called "mocoPlot.mlapp" from the terminal. The line I am using is
matlab -r mocoPlot.mlapp
Normally this would work for .m files, however it seems to not be correct for .mlapp files. Once the MATLAB instance opens, the following error appears in the console:
Unable to resolve the name mocoPlot.mlapp.
Exception "java.lang.ClassNotFoundException: com/intellij/codeInsight/editorActions/FoldingData"while constructing DataFlavor for: application/x-java-jvm-local-objectref; class=com.intellij.codeInsight.editorActions.FoldingData
>>
I could not find any documentation as to why this would not work, so I am a bit stumped on what to do in order to call the .mlapp file from the terminal. If it is relevant, my MATLAB bin is added to the environment PATH and the .mlapp file sucessfully opens when done manually.
Any help/advice is appreciated.
  1 件のコメント
Rik
Rik 2020 年 11 月 21 日
Maybe you need to provide the full path?

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

回答 (1 件)

Mario Malic
Mario Malic 2020 年 11 月 21 日
編集済み: Mario Malic 2020 年 11 月 21 日
You should provide only Application name, without extension. Also, it needs to be on MATLAB path.
  2 件のコメント
Rik
Rik 2020 年 11 月 21 日
I don't know if that also holds true for apps, but for normal scripts you can also use the full path to a file you want to run. Then it doesn't need to be on the path.
Mario Malic
Mario Malic 2020 年 11 月 22 日
One of the suggestions from the batch is not to use file extension, it might hold true for the -r option.
However, if you want to use full path then it's appropriate to pair that with run command
matlab -r "run C:\folder\app.mlapp"

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

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by