How can I run Matlab completely quiet?
Mostra commenti meno recenti
How can I run Matlab completely quiet? I want absolutely NO windows to open at any time.
I call the Matlab script from Perl: $command_string = sprintf("matlab -nosplash -nojvm -nodisplay -nodesktop -minimize -r \"run(\'main.m\'); exit;\""); system($command_string);
It STILL opens a window with the massage “To get started, type one of these: helpwin, helpdesk, or demo. ...“
This gets opened minimized, but it is still a problem. I want it completely quiet. As now I cannot use the computer while the script runs. If for instance I am writing and the Matlab script is executed the icons in the desktop toolbar blink and cursor goes to the newly opened (but minimized) window. That means that what I type just disappears.
What I want is Matlab to execute the script without opening any windows AT ALL. Is that possible?
1 Commento
Jette
il 13 Nov 2014
Risposta accettata
Più risposte (2)
Friedrich
il 13 Nov 2014
Hi all.
It is possible using WMIC on Windows, e.g. through VBS. Short and easy:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.ShowWindow = 12 'HIDDEN_WINDOW
Set objProcess = GetObject( _
"winmgmts:root\cimv2:Win32_Process")
errReturn = objProcess.Create( _
"""C:\Program Files\MATLAB\R2014b\bin\win64\matlab.exe"" -nosplash -nodesktop -r ""fid=fopen('C:\test.txt','w');fclose(fid);quit force""", null, objConfig, intProcessID)
You only need to adjust the path to MATLAB on your machine. For some reason you still need nosplash and nodesktop (I guess MATLABs window initialisation happens after Windows hooks in to hide everything. So a few windows slip through.)
1 Commento
Jette
il 13 Nov 2014
Andreas Goser
il 13 Nov 2014
0 voti
I would like discussing this from the angle of why this is important for you. From your description, I would expect MATLAB opens and then you need to minimize it once and can work with other tools. But your description also suggest you cannot type e.g. an email.
A couple of questions:
- Can it be you are running / starting MATLAB very often with this workflow?
- Is this multiple instances on your local machines?
- Why perl? Is there something you cannot do within MATLAB?
- Would you benefit from remote Access on a different machine or a Cluster?
1 Commento
Jette
il 13 Nov 2014
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!