How to run a Matlab Script via Putty?
이전 댓글 표시
I try to SSH to my desktop from the laptop and then try to run a Matlab script on the desktop. I try to use $matlab -nospalsh onodesktop - script_name command but nothing is run in the remote machine. It does not show me an error too. What would be the reason for this?
답변 (1개)
Walter Roberson
2017년 12월 19일
matlab -nosplash -nodesktop -r "try; script_name; catch; end; quit"
You might need the -nojvm option as well.
Note: matlab might not happen to be on your shell path, so you might need to give the path to the executable, such as
/Applications/MATLAB_R2017a.app/bin/matlab
Alternately if you are doing this a lot, you might want to put an alias in your ~/.bash_profile such as
alias matlab="/Applications/MATLAB_R2017a.app/bin/matlab -nosplash -nojvm -nodesktop"
after which the ssh sessions could use
matlab -r "try; script_name; catch; end; quit"
댓글 수: 1
Shehan
2017년 12월 20일
Thank you Walter. I added the details to bash_profile as mentioned and t works now.
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!