How to change the color of a lamp component when a button is pressed in AppDesigner ?

60 vues (au cours des 30 derniers jours)
Joseph le 4 Juil 2019
Commenté : Pawel le 22 Oct 2020
I have tried using the following command but it did not work:
app.mylamp.Color = [0.3010 0.7450 0.9330]

Réponses (1)

Kevin Chng
Kevin Chng le 4 Juil 2019
It should be working. I guess you miss out something, i try to do the full workflow here : I hope it helps you
1) Create button and lamp
2) Create callback function for button
3) Inside the callback function type
4) Ensure app.Lamp is the component's name
Let me know if you still cant do it.
  4 commentaires
Pawel le 22 Oct 2020
Thank you We Kai, that works!

Connectez-vous pour commenter.


En savoir plus sur Develop Apps Using App Designer 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