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

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??

Answers (1)

app.ForceEditField.Value = num2str(EEE);
or
app.ForceEditField.Value = string(EEE);

2 Comments

same problem beacause i got the equivelent string number not the number
Are app.MassEditField, app.AccEditField, and app.ForceEditField numeric or text uieditfields?

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products

Release

R2022b

Asked:

on 30 Oct 2023

Commented:

on 31 Oct 2023

Community Treasure Hunt

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

Start Hunting!