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

5 vues (au cours des 30 derniers jours)
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 commentaires
Stephen23
Stephen23 le 21 Mar 2018
"...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 le 21 Mar 2018
Have not tried that - if there is no other way will use that. Thanks!

Connectez-vous pour commenter.

Réponse acceptée

Benjamin Großmann
Benjamin Großmann le 24 Avr 2018
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.

Plus de réponses (0)

Catégories

En savoir plus sur Desktop dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by