Is there a script function or variable to determine if running on desktop?
5 ビュー (過去 30 日間)
古いコメントを表示
Craig Anderson
2018 年 3 月 21 日
回答済み: Benjamin Großmann
2018 年 4 月 24 日
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
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 ?
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!