2

I am trying to run a Matlab script from a tcl file.

There are examples elsewhere of how to do this (eg Running Matlab Command From Tcl) :

exec {*}matlab -nodisplay -nosplash -nodesktop -r "ScriptTitle; quit"

However, as far as I can see, this works by opening up a new Matlab command window before executing the Matlab script.

However, I want to call the Matlab script as part of a loop, meaning it will be called many times by my tcl code. Each time matlab is called, a new matlab command window is opened. This takes a long time as the new command window has to open and load etc before it does anything. I want to know if there is a way to access an already open matlab command window from tcl? Or, alternatively, is there a more efficient way to run Matlab from tcl that would work well as part of a frequently repeated loop?

1
  • Hmm, if it is being run like that (so no access to the display) then you might be able to control it via Expect. Commented Jan 30, 2018 at 15:01

1 Answer 1

0

MATLAB has an API engine which can be used to control it remotely. To use it from Tcl, you can write an extension or use Ffidl.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.