Want to display running information

Hi all. I am using guide. In a figure window i have a button. After clicking on the button the program is running. But it takes too much time to run. I want to display a visual information to show the users that the program is running, to understand them the machine is not hanged while the program is running. How i will do that? Is it possible to display it with a window i.e. when we copy something the window appears to show the progress of copy. plz help me. I need your help. Thanks for your valuable suggestion.

 채택된 답변

Walter Roberson
Walter Roberson 2012년 5월 6일

0 개 추천

Please see waitbar()

댓글 수: 4

SUDIP PODDAR
SUDIP PODDAR 2012년 5월 6일
Thanks for your valuable suggestion. I have a thousand of code inside the button where i refer some subfuction. Where i place this waitbar code?? please help me. Walter i tried a lot. I confused.
Walter Roberson
Walter Roberson 2012년 5월 6일
Is there a loop in the code? If so then waitbar() with a fraction of 0 before the beginning of the loop, and inside the loop probably as the last thing) update the fraction done.
Image Analyst
Image Analyst 2012년 5월 6일
If you want to print out specific words, like "code" and "loop" or "start of loop" and "end of loop" use fprintf() like this:
fprintf('Start of loop...\n');
fprintf('Inside loop, variable loopIndex = %d...\n', loopIndex);
fprintf('End of loop...\n');
Walter Roberson
Walter Roberson 2012년 5월 6일
The waitbar will _not_ close automatically: you need to close it in the program.
Divide your code into (say) 10 functional groups. At the end of each functional group, update the waitbar to represent that another group has finished. If you have a time-consuming loop inside one of the functional groups, divide the 10% (for the entire functional group) by the number of iterations for the loop, and each iteration through the loop, update the waitbar by that fraction.

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

추가 답변 (1개)

Image Analyst
Image Analyst 2012년 5월 6일

0 개 추천

In your related question ( http://www.mathworks.com/matlabcentral/answers/29608-how-embedded-jpg-image-on-panel) I said: "Try issuing the command "echo on" to see what your m-file is doing in the command window."

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by