1

I prefer using Matlab in command line.

As I know, the matlab script can be run in this way:

\> matlab < script.m

After I modified a parameter in script.m, I want to rerun it, I have to:

\> matlab < script.m

The problem is there is redundant starting of matlab, which is unnecessary. If you know JVM, it's similar to restarting JVM (java MainClass).

How to solve this?

JackWM
  • 10,085
  • 22
  • 65
  • 92
  • What's wrong with making script.m a function and calling it with different parameters within script2.m, and running "$matlab < script2.m"? – emrea Nov 27 '13 at 04:25
  • Have a look at [this answer from Sam Roberts](http://stackoverflow.com/a/18782203/2778484), a MathWorks insider. However, the COM automation part only applies to Windows. Perhaps the Java to MATLAB (JMI) functionality could be used. – chappjc Nov 27 '13 at 04:53
  • here is another solution: [Call a function by an external application without opening a new instance of Matlab](http://stackoverflow.com/questions/18781803/call-a-function-by-an-external-application-without-opening-a-new-instance-of-mat) – Robert Seifert Nov 27 '13 at 08:31
  • Also consider writing a function that accepts your parameter as an input. – Dennis Jaheruddin Nov 27 '13 at 14:07

1 Answers1

0

Call matlab.exe from {Root MATLAB}\bin\win64 or win32 instead of the root folder to prevent multiple instances

athypes
  • 185
  • 9