How to change the color of the lamp?

3 ビュー (過去 30 日間)
Muazma Ali
Muazma Ali 2023 年 2 月 22 日
コメント済み: Kevin Holly 2023 年 2 月 24 日
この 質問 は Voss さんによってフラグが設定されました
I just started converting my program to an app; I am using the one called boreholestability as the frontpage and then app2 as the one with operations which is referred to in boreholestability app
But I am failing to understand why I dont get changed the color of the lamp when the number of salts entered is greater than 3 or less than 2, this is the criterion I have coded for the lamp to change color.
Can anybody help me with that...? :)
  1 件のコメント
Voss
Voss 2023 年 2 月 22 日
Try starting with a simpler app, say an app with one NumericEditField and one lamp. In that app, get the lamp to change color based on the Value of the NumericEditField. Then build up from there to where you want to go, verifying that each incremental change you make works as you expect.

サインインしてコメントする。

回答 (1 件)

Kevin Holly
Kevin Holly 2023 年 2 月 22 日
Please see the app attached.
Note, you can set limits on your edit fields. I set this one from 1 to 4.
  5 件のコメント
Muazma Ali
Muazma Ali 2023 年 2 月 24 日
Hi @Kevin Holly! I am unable to create a separate callback function for the case when the field nr salts changes.
I also dont get the text message on my app saying value accepted or invalid input. So I dont know what is wrong with this small app.
Kevin Holly
Kevin Holly 2023 年 2 月 24 日
I noticed the same thing. The callback shown (see screenshot attached) is linked to the zones' edit field. I had to delete the edit field for number of salts and create a new one.
In the app you just attached, app.EnterthenragainTextArea does not exist as a uicomponent. Change the two occurances of "app.EnterthenragainTextArea.Value" to "app.TextArea.Value".

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by