Remote matlab running: changing folder and running script
2 views (last 30 days)
Show older comments
I was wondering how to change a matlab directory while using ssh in puTTY for a remote session that does not end when I close the ssh terminal.
So far I have:
nohup matlab -nodesktop -nodisplay < sshTest.m &
I have also tried:
nohup matlab -nodesktop -nodisplay < cd(DIRECTORY) sshTest.m &
But I get the following error:
-bash: syntax error near unexpected token `('
My matlab directory is different than the initial directory when I ssh. I am comfortable completing this in several lines, however I am unsure how to include 'nohup' for continued running of the script even if I lose connection to the server within the several line method.
This is how I did it in multiple lines:
matlab -nodesktop -nodisplay
cd(DIRECTORY)
sshTest
Any help is appreciated. Thank you.
0 Comments
Accepted Answer
Steven Lord
on 1 Sep 2022
Instead of piping the contents of the file to MATLAB, use the -batch or -r startup options in conjunction with the -sd startup option.
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown 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!