0

I'm using Matlab on a Unix server and would like to be able to keep a session opened (with Matlab windows still displayed) on a screen so that I can get back to it whenever I want.

One solution I found that may work is using "altscreen" and set it on "on".

But I'm not really sure how to proceed with it and how to properly call the function. Is it even the right way?

If anyone could give me some advice that'd be amazing!

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
oz380
  • 57
  • 3
  • 9
  • I wouldn't recommend doing so because usually the ssh connexion might get interreputed even for a few seconds which causes the window to close and the code lost. I prefer using screen and using the `-logfile` option to track progress. – Marouen Aug 07 '17 at 12:54
  • 1
    Hi Marouen! Thanks for your answer. I'm actually using screens so that I can lose ssh connection, I'm using Matlab on a remote computer and use screens to run overnight simulations. What is the most efficient way of using logfiles to go back to wherever you were on previous sessions? – oz380 Aug 07 '17 at 13:09

1 Answers1

1

you can create a new screen using screen -R myscreen then launch matlab using matlab -nodesktop -nosplash -r myscript -logfile log.out (without .m in myscript) .

The -nodesktop -nosplash option allows you to launch matlab without the GUI, then you can close the screen with CTRL+A+D.

you can check the progress on the log file without connecting to the screen.

If you want to connect back to the screen use screen -R myscreen

Marouen
  • 907
  • 3
  • 13
  • 36
  • Hi! Thanks again for your answer! I thought about this solution but I need to use Simulink too which is impossible without any GUI. The idea really was to try to store the GUI state and restore it when connecting back to the screen. Do you know if it is possible to turn on/off the GUI for Matlab when already launched? – oz380 Aug 07 '17 at 13:56
  • nothing crosses my mind now, though I am pretty sure that you can write in code what you are doing in simulink GUI. – Marouen Aug 07 '17 at 13:59