Reputation: 175
I want to launch a Linux terminal from a Matlab script in order to run an object file from the terminal. After launching the terminal the Matlab script has to continue.
I have tried both the unix()
and system()
commands, but in both the Matlab script gets stuck in the terminal script and doesn't continue.
Is there a way for a Matlab script to launch a terminal, run an executable file on it and have the Matlab script continue with the rest of the script?
Upvotes: 3
Views: 2434
Reputation: 2384
You'll want to launch a separate terminal application such as terminal, gnome-terminal, xterm, konsole, etc (see here) providing the -e flag followed by the command you want to run. Something like this:
system('gnome-terminal -e ''your command here'' &')
Upvotes: 1
Reputation: 112659
To return to Matlab immediately after starting the external process, add &
at the end of the string passed to system
. For example
system('filename &')
Upvotes: 2