App Designer, display number in numeric field

101 ビュー (過去 30 日間)
JoE
JoE 2021 年 6 月 10 日
コメント済み: Ignacio Roa 2023 年 11 月 29 日
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.
  1 件のコメント
Ignacio Roa
Ignacio Roa 2023 年 11 月 29 日
im having a similar problem. I want to display the value of theta1 but it doesnt. Only display the result if i modify the edit field were i want to show the results.
function EditField_16ValueChanged(app, event)
X = app.EditField_16.Value;
Y = app.EditField_17.Value;
Z = app.EditField_18.Value;
theta1=atan2(Y,X);
R= sqrt(X^2+Y^2);
app.EditField_9.Value=theta1;
end

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by