How to declare variable in App Designer

51 ビュー (過去 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'
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
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;
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.



Find more on Entering Commands in Help Center and File Exchange




Community Treasure Hunt

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

Start Hunting!

Translated by