How can I update gauge value display during a function?

조회 수: 10 (최근 30일)
Ali Ahmadi Dastjerdi
Ali Ahmadi Dastjerdi 2019년 5월 8일
댓글: Oskar Kilgus 2022년 8월 20일
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
Kai
Kai 2020년 6월 2일
I do have the same question. Have you solved this problem pls?

댓글을 달려면 로그인하십시오.

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 6월 2일
Use drawnow
for i=1:100
app.Gage.Value=i;
drawnow
% code
  댓글 수: 1
Oskar Kilgus
Oskar Kilgus 2022년 8월 20일
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!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by