rror using matlab.ui.control.internal.model.AbstractNumericComponent/set.Value (line 111) 'Value' must be a double scalar.
1 view (last 30 days)
Show older comments
"rror using matlab.ui.control.internal.model.AbstractNumericComponent/set.Value (line 111)
'Value' must be a double scalar."
I am getting this error message when ever i try running the code. This message after i wrote the last two lines of code, what could it be
Code
% OUTPUT
EqualSums=(SlipAmount/2)+((person1+person2)/2);
SUMPERSON1=EqualSums-Person2Debts;
SUMPERSON2=EqualSums-Person1Debts;
app.DEBTSEditField.Value=SUMPERSON1;
app.DEBTSEditField_2.Value=SUMPERSON2;
2 Comments
Answers (1)
Cris LaPierre
on 25 Jan 2021
One of two possible causes.
- SUMPERSON2 is not a double (see this question for an example)
- SUMPERSON2 is not a scalar. This error is returned if you try to assign a vector of numbers (e.g. [2, 6]);
You can duplicate the error by running the following in MATLAB.
fig = uifigure;
edt = uieditfield(fig,'numeric');
edt.Value = [5 6];
Error using matlab.ui.control.internal.model.AbstractNumericComponent/set.Value (line 111)
'Value' must be a double scalar.
The solution is to make sure SUMPERSON2 is a single numeric value.
edt.Value = 5;
0 Comments
See Also
Categories
Find more on Migrate GUIDE Apps 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!