フィルターのクリア

How to find the Process ID (PID) in matlab

142 ビュー (過去 30 日間)
Muharrem Askin
Muharrem Askin 2012 年 6 月 8 日
コメント済み: Eddy Philippe 2020 年 6 月 23 日
Is there any function or method in matlab to find the process ID (PID) of the program in the task manager ?

回答 (4 件)

Kaustubha Govind
Kaustubha Govind 2012 年 6 月 8 日
There is an undocumented (but relatively well-known) function:
>> feature getpid
  2 件のコメント
Muharrem Askin
Muharrem Askin 2012 年 6 月 11 日
Actually I would like to get the PID of another programs when they are running at the time I check it. Simply, I would not only want to get the PID of matlab but also the others listed on the task manager. Do you know how can I do that ?
Kaustubha Govind
Kaustubha Govind 2012 年 6 月 11 日
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
William Stevenson 2013 年 1 月 3 日
To find the running tasks: [response,tasks] = system('tasklist');
e.g. to find Excel [response,tasks] = system('tasklist/fi "imagename eq Excel.exe"')

Jim Hokanson
Jim Hokanson 2016 年 10 月 11 日
編集済み: Jim Hokanson 2016 年 10 月 11 日
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

Yair Altman
Yair Altman 2012 年 6 月 9 日
  2 件のコメント
Muharrem Askin
Muharrem Askin 2012 年 6 月 11 日
Actually I would like to get the PID of another programs when they are running at the time I check it. Simply, I would not only want to get the PID of matlab but also the others listed on the task manager. Do you know how can I do that ?
Eddy Philippe
Eddy Philippe 2020 年 6 月 23 日
Try [~,result] = system('tasklist');

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePID Controller Tuning についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by