How to find the Process ID (PID) in matlab
106 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Is there any function or method in matlab to find the process ID (PID) of the program in the task manager ?
0 comentarios
Respuestas (4)
Kaustubha Govind
el 8 de Jun. de 2012
There is an undocumented (but relatively well-known) function:
>> feature getpid
2 comentarios
Kaustubha Govind
el 11 de Jun. de 2012
I think you might need to figure out a Windows shell command that does that and use the SYSTEM function to call into the shell.
William Stevenson
el 3 de En. de 2013
To find the running tasks: [response,tasks] = system('tasklist');
e.g. to find Excel [response,tasks] = system('tasklist/fi "imagename eq Excel.exe"')
0 comentarios
Jim Hokanson
el 11 de Oct. de 2016
Editada: Jim Hokanson
el 11 de Oct. de 2016
A .NET solution:
name = 'excel'; %for example
p = System.Diagnostics.Process.GetProcessesByName(name);
if p.Length == 1
pid = p(1).Id; %You must index into p (not p.Id), as this changes the class type
end
0 comentarios
Ver también
Categorías
Más información sobre PID Controller Tuning 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!