When i Run the following code i got an error in app designer?

1 次查看(过去 30 天)
Dear All,
When i trying run the following code i got an error of Error using matlab.ui.control.EditField/set.Value 'Value' must be a character vector or a string scalar.
Mass=app.MassEditField.Value;
ACC=app.AccEditField.Value;
EEE=(Mass*ACC);
app.ForceEditField.Value=EEE ;
Can Anyone help me??

回答(1 个)

Voss
Voss 2023-10-30
app.ForceEditField.Value = num2str(EEE);
or
app.ForceEditField.Value = string(EEE);
  2 个评论
Mostafa Salah
Mostafa Salah 2023-10-31
same problem beacause i got the equivelent string number not the number
Voss
Voss 2023-10-31
Are app.MassEditField, app.AccEditField, and app.ForceEditField numeric or text uieditfields?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by