Calling a MATLAB Application file from a terminal
12 views (last 30 days)
Show older comments
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.
Answers (1)
Mario Malic
on 21 Nov 2020
Edited: Mario Malic
on 21 Nov 2020
You should provide only Application name, without extension. Also, it needs to be on MATLAB path.
2 Comments
Rik
on 21 Nov 2020
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
on 22 Nov 2020
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"
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!