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

8 ビュー (過去 30 日間)
Mostafa Salah
Mostafa Salah 2023 年 10 月 30 日
コメント済み: Voss 2023 年 10 月 31 日
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 Center および File ExchangeWhos についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by