フィルターのクリア

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 Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by