Running matlab in the background

后端 未结 6 661
北恋
北恋 2021-02-04 17:25

I am running matlab on 48 virtual machines and would like to automate it. I ssh into the machines then use matlab -r matlab_command > outfile.txt & to get t

6条回答
  •  清歌不尽
    2021-02-04 17:52

    The real clean solution to your problem is to use GNU Screen. Then you will not loose your Matlab session and you can always get back into the Matlab prompt. Very helpful if somebody went wrong with your Matlab code and you need to debug a little.

    Just fire up 'screen' (after you have the package installed, included in all major distributions). You will have a typical prompt, but inside a persistent, virtual terminal. Start your matlab as usual, omit any backgrounding. Then press CTRL+A, D (first CTRL+A, then d). You will be out of screen. You can logout. If you want to get back to your screen session, run screen -r. If you want, you can also directly start screen matlab [...] in the first place. It will have the effect that your virtual session is also dropped when matlab quits.

提交回复
热议问题