필터 지우기
필터 지우기

Want to programmatically get the Maltlab status of (ready, busy), etc., in the bottom left corner of the window. What procedure will be used?

조회 수: 3 (최근 30일)
It's framed in red in the bottom left corner of the window.
  댓글 수: 3
BN
BN 2024년 6월 13일
Because my program runs for a long time, get status. I just want to know if the program is running properly.
Jonas
Jonas 2024년 6월 13일
i would gueaa just asking for the busy state does not tell you if the programm is running properly. I experienced it multiple times, that matlab is busy, but it did nothing and the program hanged. if you want a more reliable way of telling if there is progress, you can write some status messages now and then using e.g. disp(). you can include there the time of displaying the message and maybe the progression, e.g. a loop variable and total nummber of loops

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

답변 (2개)

Nihal
Nihal 2024년 6월 13일
When a program is executing, the command window displays a status text of 'Busy'. However, this status update does not occur during the execution of a timer object's callback. Thus, the presence of status text can indicate Matlab's activity state. CmdWinTool infers Matlab is occupied whenever the status text is present, a condition that also arises if execution halts during debugging.
isBusy = CmdWinTool('isBusy')

Aquatris
Aquatris 2024년 6월 13일
I recommend you use waitbar() function as an indicator of the progress within the code.
f = waitbar(0,'Program started...');
%%% SOME CODE
waitbar(.2,f,'Uploading data ...');
%%% SOME CODE
waitbar(.5,f,'Post processing data ...');
%%% SOME MORE CODE
waitbar(0.9,f,'Generating report ...');
%%% Final codes CODE
waitbar(1,f,'DONE!');
close(f)

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by