Unable to change label text via code

6 ビュー (過去 30 日間)
Basem Nabil
Basem Nabil 2019 年 5 月 8 日
コメント済み: Walter Roberson 2019 年 5 月 9 日
Hello,
I have created several labels using app designer but whenever I try to change a label text within a callback of a button it gives me an error for the equal sign '='
app.label9.Text = 'Incorrect values';
  7 件のコメント
Basem Nabil
Basem Nabil 2019 年 5 月 9 日
Thank you, I'm just used to other languages which use braces for block of code.
however, I've experienced another issue. The code works now but displays '...' instead of the text I assigned it to be. Do you have any clue why this happens?
Walter Roberson
Walter Roberson 2019 年 5 月 9 日
I believe that can happen if you have set text that is wider than the width the control has been set to.

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

採用された回答

Adam Danz
Adam Danz 2019 年 5 月 8 日
編集済み: Adam Danz 2019 年 5 月 8 日
(Continuing from comments under question)
That's not matlab syntax. Looks like cpp. If you have this opened in your matlab editor, it should be lighting up like Rudolph with red underlines.
Correct way:
if condition
% code
else
%code
end

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by