rror using matlab.ui.control.internal.model.AbstractNumericComponent/set.Value (line 111) 'Value' must be a double scalar.
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
JUNGCHENG WU
on 25 Jan 2021
same problem ORZ have you solved yet?
Walter Roberson
on 25 Jan 2021
What is class() of SUMPERSON1 and 2? What are size() of them?
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;
Categories
Find more on Desktop 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!