How can I run Matlab completely quiet?
이전 댓글 표시
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?
채택된 답변
추가 답변 (2개)
Friedrich
2014년 11월 13일
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.)
Andreas Goser
2014년 11월 13일
0 개 추천
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?
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!