How to close system command prompt opened by MATLAB !command?
54 ビュー (過去 30 日間)
古いコメントを表示
Dominik Mattioli
2019 年 7 月 10 日
コメント済み: Alibert Luna Palomino
2022 年 5 月 15 日
I've seen similar questions but not ones that involve opening the command window/terminal via "!". I'm using a MATLAB-to-Python socket connection and I want to close the command window/terminal at the end.
% Start the echo server in python.
!python echo_server.py &
% Do some stuff with my sockets.
% Close the connection.
fclose(tcp);
%%% Close the terminal here?
The opened command line/terminal says at the top "C:\WINDOWS\SYSTEM32\cmd.exe" following the closing of the socket.
3 件のコメント
採用された回答
Jalaj Gambhir
2019 年 7 月 19 日
Hi,
As rightly pointed out by @Walter, the command
system('Taskkill/IM cmd.exe')
closes all the opened command windows.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Predictive Maintenance Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!