kill a processb from matlab
    12 次查看(过去 30 天)
  
       显示 更早的评论
    
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
0 个评论
回答(2 个)
  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
 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
      
      
 2022-4-27
				What code are you using? The code I posted does not use any MATLAB function named TaskKill 
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



