Any master willing to guide a beginner to code the app of 2 input and lamp as output (appdesigner)?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/197615/image.png)
The condition is either input entry is >= 10, then the lamp will turn Red, otherwise turn green.
Your kindness will be deeply appreciated and paid it forward.
0 commentaires
Réponse acceptée
Kevin Chng
le 11 Oct 2018
Modifié(e) : Kevin Chng
le 11 Oct 2018
Hi engchai Ang,
I guess you have tried your best to do it. Refer to my code, paste this code in your callback function
a = app.Input1EditField.Value;
b = app.Input2EditField.Value;
if a>=10 || b>=10
app.Lamp.Color = [1 0 0]
else
app.Lamp.Color = [0 1 0]
end
However, I have attached a .m file for you.
.mlapp file is not allowed to be uploaded here. Hence, i copy the code and paste it in .m file for you.
Plus de réponses (0)
Voir également
Catégories
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!