Thread Subject: waitbar with 2 bars

Subject: waitbar with 2 bars

From: Gavrilo Bozovic

Date: 7 Nov, 2008 13:49:02

Message: 1 of 3

Hi!

I have a function that runs for a long time, with two imbricated for loops.

Is it possible to have a waitbar window with two waitbars, one showing the progression within the first loop, and one within the imbricated one?

Thanks in advance!

Subject: waitbar with 2 bars

From: Steven Lord

Date: 7 Nov, 2008 14:49:55

Message: 2 of 3


"Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message
news:gf1h0e$8d5$1@fred.mathworks.com...
> Hi!
>
> I have a function that runs for a long time, with two imbricated for
> loops.
>
> Is it possible to have a waitbar window with two waitbars, one showing the
> progression within the first loop, and one within the imbricated one?

Not without creating a modified WAITBAR function and tweaking it to do what
you've described. However, you can do something similar to what you've
described:


h1 = waitbar(0, 'Waitbar 1', 'Units', 'normalized', 'Position', [0.25 0.4
0.25 0.2]);
for k = 1:10
    waitbar(k/10, h1);
    pause(0.1)
    h2 = waitbar(0, 'Waitbar 2', 'Units', 'normalized', 'Position', [0.5 0.4
0.25 0.2]);
    for m = 1:20
        waitbar(m/20, h2);
        pause(0.1)
    end
    close(h2)
end


--
Steve Lord
slord@mathworks.com

Subject: waitbar with 2 bars

From: Gavrilo Bozovic

Date: 10 Nov, 2008 09:07:01

Message: 3 of 3

"Steven Lord" <slord@mathworks.com> wrote in message <gf1kij$mj6$1@fred.mathworks.com>...
>
> "Gavrilo Bozovic" <gavrilo.bozovic@helbling.ch> wrote in message
> news:gf1h0e$8d5$1@fred.mathworks.com...
> > Hi!
> >
> > I have a function that runs for a long time, with two imbricated for
> > loops.
> >
> > Is it possible to have a waitbar window with two waitbars, one showing the
> > progression within the first loop, and one within the imbricated one?
>
> Not without creating a modified WAITBAR function and tweaking it to do what
> you've described. However, you can do something similar to what you've
> described:
>
>
> h1 = waitbar(0, 'Waitbar 1', 'Units', 'normalized', 'Position', [0.25 0.4
> 0.25 0.2]);
> for k = 1:10
> waitbar(k/10, h1);
> pause(0.1)
> h2 = waitbar(0, 'Waitbar 2', 'Units', 'normalized', 'Position', [0.5 0.4
> 0.25 0.2]);
> for m = 1:20
> waitbar(m/20, h2);
> pause(0.1)
> end
> close(h2)
> end
>
>
> --
> Steve Lord
> slord@mathworks.com
>

hi Steve!

Thanks for your answer, that will do the trick for my application!

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
waitbar Gavrilo Bozovic 7 Nov, 2008 08:50:04
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com