MATLAB Answers

Any master willing to guide a beginner to code the app of 2 input and lamp as output (appdesigner)?

1 view (last 30 days)
Andrew Ang
Andrew Ang on 11 Oct 2018
Commented: Andrew Ang on 12 Oct 2018
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.


Sign in to comment.

Accepted Answer

Kevin Chng
Kevin Chng on 11 Oct 2018
Edited: Kevin Chng on 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]
app.Lamp.Color = [0 1 0]
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.

  1 Comment

Andrew Ang
Andrew Ang on 12 Oct 2018

Kevin Chng, A Million thanks for your thoughtfulness and kindness. Wish you and your beloved one are always with pleasant sunshine.

Sign in to comment.

More Answers (0)

Translated by