Unable to change label text via code

6 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by