Is there a way to retrieve MATLAB busy status from a C# application

조회 수: 2 (최근 30일)
Can Dogu
Can Dogu 2021년 9월 28일
댓글: Can Dogu 2021년 9월 29일
I am developing an application that determines matlab is idle for some time. I do this by calculating cpu times for now. I wonder if there is a way to retrieve matlab busy status (running a script) from my external c# application.
Thanks.

답변 (1개)

Jan
Jan 2021년 9월 28일
The direct solution is to let the Matlab script trigger this:
function SetBusyFlag(ScriptName)
FlagFile = fullfile(tempdir, 'MatlabIsBusy.flag');
[fid, msg] = fopen(FlagFile, 'W');
assert(fid > 0, msg);
fclose(fid);
run(ScriptName);
delete(FlagFile);
end
As long as the flag file is existing, the script is still running.
  댓글 수: 2
Can Dogu
Can Dogu 2021년 9월 29일
Thanks for your reply. I understand that i cannot get busy flag from outside of matlab am i right?
Can Dogu
Can Dogu 2021년 9월 29일
Actually i need and idle detector for my company users. I run a windows service that determines if specific matlab instance is idle or not by calculating its cpu usage for now. I want to convert this method to retrieve its busy flag by asking matlab instance. Is this possible?
Thanks.

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

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by