Unable to change label text via code
古いコメントを表示
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 件のコメント
Adam Danz
2019 年 5 月 8 日
From appdesigner, select the red-underlined equal sign and press ctrl+m. It should tell you why it's underlined. What does that message say?
Basem Nabil
2019 年 5 月 8 日
That's what I thought. So somewhere in your code above that line you're missing one of those closed-grouping characters. Here's an example that recreates your exact problem:
t = [1:100; % <---- missing the closed bracket "]"
a = t(1:10);

Basem Nabil
2019 年 5 月 8 日
Walter Roberson
2019 年 5 月 8 日
MATLAB does not use {} for code grouping, only for creating or indexing cell arrays.
Basem Nabil
2019 年 5 月 9 日
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.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Axis Labels についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
