How to programmatically determine if in headless mode..?
17 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Bradley Stiritz
el 14 de En. de 2012
Comentada: Seth Hillery
el 13 de Mayo de 2025
I'm working on an issue with the Parallel Computing Toolbox (PCT)..
As each MATLAB.exe worker thread process is initialized, startup.m is executed. All worker threads are "headless" (no output window). Certain graphics-related function calls that are fine-- when launched within the full MATLAB app with its output capability-- can cause problems in the headless context.
I have a graphics-related function that's very convenient to have in the full MATLAB app's startup.m, but mustn't execute in the PCT worker thread context. Is there a function call I can insert into startup.m to determine if its MATLAB.exe process is running in headless mode? I would like to use as follows:
% Is there an output window associated with this MATLAB.exe process?
if ~isInHeadlessMode()
% YES : render graphics window
someGraphicsFunction();
end
Any help appreciated, Thanks, Brad
0 comentarios
Respuesta aceptada
Edric Ellis
el 16 de En. de 2012
One option is to check:
java.lang.System.getProperty( 'java.awt.headless' )
4 comentarios
Seth Hillery
el 13 de Mayo de 2025
unfortunately this only works for traditional desktop environments. Is there any way to also detect say a matlab online/matlab-proxy-app browser based environment?
Más respuestas (1)
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!