waitbar + surf functions. are they incompatible?
Mostra commenti meno recenti
[EDIT: 20110621 14:54 CDT - reformat - WDR]
When trying to establish a waitbar for a double-cycle I am using, I have found out that it is not possible to run it simultaneously with the surf function.
Example:
aux = 0;
steps = length(stelement)*length(csplate);
progressbar = waitbar(0,'graphic under construction...');
for el = 1:length(stelement)
for pl = 1:length(csplate)
aux = aux + 1;
waitbar(aux/steps);
[xplot,yplot,zplot,plotSxx] = stressplot(pl,el);
surf(xplot,yplot,zplot,plotSxx);
hold on;
end
end
close(progressbar)
Question is whether it is possible to overcome this problem in any other way.
Thanks,
PN
Risposta accettata
Più risposte (2)
PN
il 21 Giu 2011
Matt Fig
il 21 Giu 2011
From the help for WAITBAR (always a good place to look with any funciton!), we have this:
h = waitbar(0,'Please wait...'); % Create a waitbar.
then later:
for i=1:1000,
% computation here %
waitbar(i/1000,h) % Update the existing waitbar.
end
So you see, your update to the waitbar expects the handle returned from when you first invoked it - before the loop...
1 Commento
Walter Roberson
il 21 Giu 2011
The doc shows that the handle is not (always) necessary.
Categorie
Scopri di più su App Building in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!