$ matlab -nodesktop -nojvm &
How would I execute matlab commands on the session that was just created?
In other words, I want to have a matlab session running in the background, and execute matlab commands and/or scripts from an arbitrary terminal at any given time without having to create a new session.
I would suggest a similar solution as carandraug did, only I prefer
tmuxas the multiplexer. It may be a bit tricky getting the commands passed in correctly so create a shell-script that handles the details.Let’s say you’ve started
matlabin a terminal like this:Now a
tmuxsession called matlab is running matlab with no gui.Create this shell-script:
mx
In a different terminal you can now run quoted matlab commands:
Or even pass commands in through a pipe: