How can I update gauge value display during a function?

10 vues (au cours des 30 derniers jours)
Ali Ahmadi Dastjerdi
Ali Ahmadi Dastjerdi le 8 Mai 2019
Commenté : Oskar Kilgus le 20 Août 2022
I am writing aone app in appdesigner. I want to monitor the prograse of my function using Gauge. My code is like:
for i=1:100
app.Gage.Value=i;
.....
.....
end
The problem is that, the app.Gage.Value is changed but It does not display and after finishing the for loop which takes 10 minutes, the gage shows immidiately 100. How can I display the correct app.Gage.Value during running for loop?
  1 commentaire
Kai
Kai le 2 Juin 2020
I do have the same question. Have you solved this problem pls?

Connectez-vous pour commenter.

Réponses (1)

Ameer Hamza
Ameer Hamza le 2 Juin 2020
Use drawnow
for i=1:100
app.Gage.Value=i;
drawnow
% code
  1 commentaire
Oskar Kilgus
Oskar Kilgus le 20 Août 2022
Hi Ameer, i´ve got a question about combining an Gauge Value with a Lamp.
So ive implemented a Gauge just the way you suggested (works just fine) and i now want to make a lamp turn from green to red with an if-statement when the currenct gauge value is lets say about 10 higher than the last one.
Thanks in advance!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by