Why do I keep getting this error in my app designer?

1 回表示 (過去 30 日間)
Hind Aljallaf
Hind Aljallaf 2023 年 5 月 13 日
編集済み: Hiro Yoshino 2023 年 5 月 14 日
I keep getting this error for a reason I am not sure off. I did train my folder, and I also made sure to input the correct name for the file within the code. What am I doing wrong? What does this error mean?
this is how the application looks like incase you might need it.
  1 件のコメント
Simon Chan
Simon Chan 2023 年 5 月 13 日
Just have a quick look, the name of the function should be strcmp instead of strcmps

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

回答 (1 件)

Hiro Yoshino
Hiro Yoshino 2023 年 5 月 14 日
編集済み: Hiro Yoshino 2023 年 5 月 14 日
(1) This might be irrelevant ... You should change "ans" to something else since ans is already taken.
(2) strcmp, "string" is redundant.
myAns = "tulip";
if (strcmp(myAns,"tulip"))
app.Lamp.Color = "Pink";
elseif(strcmp(myAns,"sunflower"))
app.Lamp.Color = "Purple";
end
Another approach is using "switch".

カテゴリ

Help Center および File ExchangeInstall Products についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by