How to retrieve startup options of current matlab session?

2 visualizaciones (últimos 30 días)
Hi, I want to change the behavior of a function it is running in command line only mode (-nodesktop startup option).
How can I know what startup options were used in the session were the function is running?
Thanks

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 5 de Oct. de 2014
Camilo - you can try using the usejava command to determine if a specific feature is available. With the option 'desktop', you can determine if the MATLAB interactive desktop is running or not.
For example, if using MATLAB normally (not launching from command line), execute the statement from the Command Window
isDesktopAvail = usejava('desktop');
sets the isDesktopAvail flag to one/true.
If launching MATLAB from the command line with
./matlab -nodesktop -nosplash
then executing the same command (from above) sets isDesktopAvail to 0/false.
This was tested with R2014a on OS X 10.8.5.
  2 comentarios
Camilo Rada
Camilo Rada el 5 de Oct. de 2014
In the thread you mention they say that this option would fail to give the right answer under -nodesktop option only. But I just tested it (in matlab version 8.1.0.604 (R2013a)), and it works perfectly. Thanks a lot!
Mats Widmark
Mats Widmark el 17 de Ag. de 2023
Editada: Mats Widmark el 17 de Ag. de 2023
Hi, I'm still interested in the original question, i.e. is there a way to find what startup parameters were used for the session in question. Specifically the -r arguments to be executed at startup. The reason is that another tool (Carsim) opens Matlab in a specific way and I would like to perform some actions if so.
Or I realized that Carsim is accessing Matlab through a COM server. A related issue is that I would like to have my current Matlab session as the server, rather than that a new Matlab instance is started that acts as server. Is there any way to control that?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by