MATLAB Answers

App Designer, display number in numeric field

조회 수: 2(최근 30일)
JoE
JoE 2021년 6월 10일
답변: Shadaab Siddiqie 2021년 6월 15일
Hey guys,
Im new to the app designer. All i want to do right now is to change the value of a numeric edit field.
Im holding it very basic. I use a push button and a numeric field. Sadly the displayed number in the app is not changing. Any help?
This line is changing the value but doesnt change the displayed number.
function ButtonPushed(app, event)
TESTEditField.Value = 1337;
end
  댓글 수: 1
JoE
JoE 2021년 6월 10일
function ButtonPushed(app, event)
app.TESTEditField.Value = 1337;
end

댓글을 달려면 로그인하십시오.

답변(1개)

Shadaab Siddiqie
Shadaab Siddiqie 2021년 6월 15일
From my understanding you are getting an not able to change the testeditfield value, this is because you are not setting this variable inside the app object. Thus you can set the TESTEditField.Value present in the app object like so:
function ButtonPushed(app, event)
app.TESTEditField.Value = 1337;
end
Hope this made it clear.

Community Treasure Hunt

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

Start Hunting!

Translated by