How can I update gauge value display during a function?

10 views (last 30 days)
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?

Answers (1)

Ameer Hamza
Ameer Hamza on 2 Jun 2020
Use drawnow
for i=1:100
app.Gage.Value=i;
drawnow
% code
  1 Comment
Oskar Kilgus
Oskar Kilgus on 20 Aug 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!

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!