How can I change the lamp color while the application is running?

조회 수: 32 (최근 30일)
Hi everybody!
I want to inroduce a lamp in my applycation, that shows the status of the application.
-Grey: introducing data.
-Red: calculating.
-Green finished.
The PROBLEM is that while the aplication is running the lamp color doesn´t change. When introducing the data it is grey, as it is set, but when I press the calculation button, it doesn`t change color to red, even if it is the first comand in the code. It seems like the application cannot send the order in real time.
I tried the following and no one worked:
  • Switch command.
  • Lamps states.
  • Internal function.
Any suggestion to get the lamp red while runnig and green when finished?
Thanks!
  댓글 수: 4
Walter Roberson
Walter Roberson 2019년 11월 19일
Are you talking about a uilamp component? https://www.mathworks.com/help/matlab/ref/matlab.ui.control.lamp-properties.html ? If so then are you using drawnow() after you set the lamp state so that MATLAB has a chance to update the screen?
Esteban Zubiria
Esteban Zubiria 2019년 11월 19일
Yes I was talking about uilamp component and I wasn´t using drawnow().
Now that I am using it, it works as I wanted.
Thank you very much Walter!

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

채택된 답변

Walter Roberson
Walter Roberson 2019년 11월 19일
Use drawnow() to give MATLAB a chance to update the screen.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by