waitbar in GUI (by pushing a button to run a m-file)

조회 수: 2 (최근 30일)
mohammad
mohammad 2012년 8월 7일
I have a m-file and now I want to make a GUI for it. In this m-file there is a For-loop that contains a waitbar that you can see below:
h=waitbar(0,'Please wait','Name','Inputs');
for o = 1:N %N is defined before
waitbar(o/N,h);
end
Now, how could this waitbar be shown inside the gui (not in another windows and not outside the gui) by pushing a button for running thid code?

채택된 답변

Walter Roberson
Walter Roberson 2012년 8월 7일
waitbar() always creates a new figure to display the bar in.
You can examine the waitbar code and adapt it for your own needs (calling the result something else!)
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 8월 8일
That code creates a new figure.
If you have a restriction that does not allow you to create a new figure for the waitbar(), then you should list what other restrictions you have. For example, is it okay if we clear the existing figure and put the waitbar in it?
mohammad
mohammad 2012년 8월 8일
Walter, thanks for reply. I mean its be nice if the waitbar be shown on the same gui windows that I run the m-file from that gui. (On this gui there is a push-button for running that m-file and under this push-button I want a waitbar to be shown the progress of running this m-fi.)

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by