필터 지우기
필터 지우기

why does windows command shell close?

조회 수: 11 (최근 30일)
William Rose
William Rose 2018년 1월 20일
편집: Greg 2018년 1월 21일
in Matlab 2017a on Windows 10, I have compiled my Matlab script. I made sure the box "Do not display the Windows Command Shell (console) for execution" was NOT checked. The uncompiled program runs fine and prints results to the Matlab command window. The compiled program runs and the console window is open while the program runs, but as soon as the program finishes, the console window closes. How do I prevent he console window from closing when program finishes?

채택된 답변

Greg
Greg 2018년 1월 21일
편집: Greg 2018년 1월 21일
The task is finished, so the process ends. Ending the process closes the command prompt.
You can launch a Windows command prompt and call the executable from there.
Or you can add something to the end of your code to prevent completion. One idea is:
if isdeployed % Optional, use if you want the non-deployed version to exit immediately
input('Press enter to finish and close');
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by