필터 지우기
필터 지우기

script sh to run a matlab program

조회 수: 2 (최근 30일)
Francesco
Francesco 2012년 3월 7일
i have to run a matlab program in background on a remote server, using a bourne shell. i tried to figure out what i have to do on the web, but i still haven't managed to do it.
i tried with the script try.sh:
#!/bin/sh
matlab my_prog.m output &
with my_prog.m the test program:
ok_string='ok';
save('ok.mat','ok_string')
which are my errors?

채택된 답변

Daniel Shub
Daniel Shub 2012년 3월 7일
I would change the script to be:
/full/path/to/matlab/binary/matlab -nodesktop -r my_prog
Note that the .m extension is left off the input script. Also, make sure you add
exit;
to the end of your m file. You also might want to hardcode the path in the m file.
  댓글 수: 3
Daniel Shub
Daniel Shub 2012년 3월 7일
@Walter, thank you. Fixed.
Francesco
Francesco 2012년 3월 8일
it worked, i forgot to add
exit
thank you all.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by