Proper if/else statement in appdesigner
古いコメントを表示
In app designer I would like to setup an if/else function that will control the lamp color. I want a value to be within 5% of control value to activate a lamp. I’m trying the below statement but it doesn’t seem to work even when values are exactly the same.
if app.rr_camber_ref.Value >= app.rr_camber.Value*0.95 && app.rr_camber_ref.Value <=app.rr_camber.Value*1.05
app.Lamp_rr_camber.Color='g';
else...
Can someone suggest what would be proper condition statement in this case?
Thank you,
Ted
3 件のコメント
Walter Roberson
2022 年 10 月 14 日
For debugging purposes, stop at that line and then test
class(app.rr_camber_ref.Value)
class(app.rr_camber.Value)
size(app.rr_camber_ref.Value)
size(app.rr_camber.Value)
disp(app.rr_camber_ref.Value)
disp(app.rr_camber_ref.Value)
Cris LaPierre
2022 年 10 月 14 日
What components are you using for app.rr_camber_ref and app.rr_camber? What are typical values for each?
Tudor Miron
2022 年 10 月 14 日
編集済み: Tudor Miron
2022 年 10 月 14 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で App Building についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!