필터 지우기
필터 지우기

Is there a script function or variable to determine if running on desktop?

조회 수: 10 (최근 30일)
I have a script which I run from the Matlab desktop/display. I wish to run it from the Linux command line without the desktop (using the -nodesktop option). But there are functions in the script which exit if running without the Matlab desktop. Is there a way in the script to not execute those commands if not running on the desktop?
  댓글 수: 2
Stephen23
Stephen23 2018년 3월 21일
"...there are functions in the script which exit if running without the Matlab desktop."
Have you tried a judicious application of try and catch ?
Craig Anderson
Craig Anderson 2018년 3월 21일
Have not tried that - if there is no other way will use that. Thanks!

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

채택된 답변

Benjamin Großmann
Benjamin Großmann 2018년 4월 24일
From the documentation:
USED = desktop('-inuse') % returns whether or not the Desktop is currently in use. It does not start the Desktop.
This function returns a logical value which you could use for some conditional statements.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by