How to close system command prompt opened by MATLAB !command?
50 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dominik Mattioli
el 10 de Jul. de 2019
Comentada: Alibert Luna Palomino
el 15 de Mayo de 2022
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 comentarios
Dominik Mattioli
el 10 de Jul. de 2019
Editada: Dominik Mattioli
el 10 de Jul. de 2019
Respuesta aceptada
Jalaj Gambhir
el 19 de Jul. de 2019
Hi,
As rightly pointed out by @Walter, the command
system('Taskkill/IM cmd.exe')
closes all the opened command windows.
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre Predictive Maintenance Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!