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

2 views (last 30 days)
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.

Answers (1)

Jan
Jan on 28 Sep 2021
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 Comments
Can Dogu
Can Dogu on 29 Sep 2021
Thanks for your reply. I understand that i cannot get busy flag from outside of matlab am i right?
Can Dogu
Can Dogu on 29 Sep 2021
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.

Sign in to comment.

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!