필터 지우기
필터 지우기

How to make a MATLAB Server for the mobile app, so that MATLAB is still active after logging out from SSH session?

조회 수: 1 (최근 30일)

I was trying to make my own MATLAB server in place of the MathWorks Cloud which is very slow in terms of connection and brings a huge network delay. And the MathWorks Cloud have more restrictions and limits on the complexity of computations, e.g. the size.

But I could not solve the problem that I have to keep the SSH session open for MATLAB to be working. I tried the beloved nohup option, with the code below, but MATLAB would then get invalid input from /dev/null.

    nohup matlab -r "connector on;"

And if I make a MATLAB script to run the connector on command, MATLAB will simply exit after the command finishes.

Is it possible to achieve this?

답변 (1개)

Benjamin Kraus
Benjamin Kraus 2018년 2월 14일
편집: Benjamin Kraus 2018년 2월 14일
Have you tried screen?
You can also try adding a startup.m file that turns on the connector, rather than using -r.
  댓글 수: 2
jackxujh
jackxujh 2018년 2월 22일

I tried screen, but it did not help:

    screen matlab -r "connector on MATLAB;" >> matlab.out &

Is that correct?

Meanwhile, I tried using a .m file as input, but MATLAB will automatically exit after it finishes the content, which is, connector on.

    nohup '/usr/local/MATLAB/R2017b/bin/matlab' < 'enable_MATLAB_Connector.m'
Benjamin Kraus
Benjamin Kraus 2018년 2월 23일
편집: Benjamin Kraus 2018년 2월 23일
Did you try using startup.m to start the connector, instead of using -r?
I haven't personally used screen in a long time, so I'm not sure of the correct syntax, but I know it is a way to get processes to run after you have logged out of the terminal.
I think I would start by starting screen, then separately starting MATLAB, then while MATLAB is running start the connector. Then you should be able to log out without stopping that running session of MATLAB.

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

카테고리

Help CenterFile Exchange에서 Installation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by