Is it possible to change the color of the " waitbar" in the GUI? i mean the red colored thing moving inside the wait bar ? if yes how?

5 vues (au cours des 30 derniers jours)
please help.

Réponse acceptée

Geoff Hayes
Geoff Hayes le 8 Fév 2015
% create the wait bar
h = waitbar(0,'Please wait...');
% find the patch object
hPatch = findobj(h,'Type','Patch');
% change the edge and face to blue
set(hPatch,'FaceColor',[0 0 1], 'EdgeColor',[0 0 1]);
% run the wait bar
steps = 1000;
for step = 1:steps
% computations take place here
waitbar(step / steps)
end
close(h)
When you execute the above, the bar will now be blue rather than the default red. Try it and see what happens!
  3 commentaires

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Dialog Boxes dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by