kill a processb from matlab

조회 수: 26 (최근 30일)
Sajid Afaque
Sajid Afaque 2020년 1월 14일
댓글: Walter Roberson 2022년 4월 27일
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

답변 (2개)

Selva Karna
Selva Karna 2020년 1월 14일
from command window enter key word : cntorl +C
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 1월 14일
That cannot be used to kill a particular process using its PID.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2020년 1월 14일
pid = whatever number
if ispc
cmd = sprintf('taskkill /PID %d', pid);
else
cmd = sprintf('kill %d', pid);
end
system(cmd)
  댓글 수: 4
Juan Troya
Juan Troya 2022년 4월 27일
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 2022년 4월 27일
What code are you using? The code I posted does not use any MATLAB function named TaskKill

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 PID Controller Tuning에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by