kill a processb from matlab

18 visualizaciones (últimos 30 días)
Sajid Afaque
Sajid Afaque el 14 de En. de 2020
Comentada: Walter Roberson el 27 de Abr. de 2022
hello all
i have got the process id [pid] of an external process.
what is the syntax to kill that process using the pid.
i want to kill using pid not by process name from matlab

Respuestas (2)

Selva Karna
Selva Karna el 14 de En. de 2020
from command window enter key word : cntorl +C
  1 comentario
Walter Roberson
Walter Roberson el 14 de En. de 2020
That cannot be used to kill a particular process using its PID.

Iniciar sesión para comentar.


Walter Roberson
Walter Roberson el 14 de En. de 2020
pid = whatever number
if ispc
cmd = sprintf('taskkill /PID %d', pid);
else
cmd = sprintf('kill %d', pid);
end
system(cmd)
  4 comentarios
Juan Troya
Juan Troya el 27 de Abr. de 2022
I get this error
Using Matlab R2018B
Error using TaskKill
Too many input arguments.
MATLAB:TooManyInputs
Error: Too many input arguments.
Walter Roberson
Walter Roberson el 27 de Abr. de 2022
What code are you using? The code I posted does not use any MATLAB function named TaskKill

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by