Path: news.mathworks.com!not-for-mail
From: "Steven Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: waitbar with 2 bars
Date: Fri, 7 Nov 2008 09:49:55 -0500
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <gf1kij$mj6$1@fred.mathworks.com>
References: <gf1h0e$8d5$1@fred.mathworks.com>
Reply-To: "Steven Lord" <slord@mathworks.com>
NNTP-Posting-Host: lords.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1226069395 23142 144.212.105.187 (7 Nov 2008 14:49:55 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 7 Nov 2008 14:49:55 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:499516



"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