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
Walter Roberson 2017년 12월 19일

1 개 추천

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
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에 대해 자세히 알아보기

질문:

2017년 12월 19일

댓글:

2017년 12월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by