Unable to change label text via code

조회 수: 12 (최근 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 CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by