Unable to change label text via code
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Basem Nabil
am 8 Mai 2019
Kommentiert: Walter Roberson
am 9 Mai 2019
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';
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/218585/image.png)
7 Kommentare
Walter Roberson
am 9 Mai 2019
I believe that can happen if you have set text that is wider than the width the control has been set to.
Akzeptierte Antwort
Adam Danz
am 8 Mai 2019
Bearbeitet: Adam Danz
am 8 Mai 2019
(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.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/218635/image.jpeg)
Correct way:
if condition
% code
else
%code
end
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!