How to declare variable in App Designer

조회 수: 37 (최근 30일)
Jakub Wojturski
Jakub Wojturski 2022년 1월 7일
댓글: Jakub Wojturski 2022년 1월 7일
Good morning.
1. I declare in App Designer the text variable A
properties (Access = private)
A = 'text'
end
2. When I push Button I call the variable A and display its value in Command Window
% Button pushed function: Button
function ButtonPushed(app, event)
text = app.A
end
In this way everything is okay.
But I can not deal with the problem, how to do that the value of variable A is not declared as a written text but it is taken as a value of EditField (Text)
% Callback function
function EditFieldValueChanged(app, event)
value = app.EditField.Value;
end
Thank you for your help.

답변 (1개)

Mohammad Sami
Mohammad Sami 2022년 1월 7일
Do you mean you want to set the value of A equal to the value of edit field ?
app.A = app.EditField.Value;
  댓글 수: 1
Jakub Wojturski
Jakub Wojturski 2022년 1월 7일
Yes. I want to assign the value of the edit field to the variable A.

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

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by