Is there a way to retrieve MATLAB busy status from a C# application
2 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
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.
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!