rror using matlab.ui.​control.in​ternal.mod​el.Abstrac​tNumericCo​mponent/se​t.Value (line 111) 'Value' must be a double scalar.

"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 comentarios

same problem ORZ have you solved yet?
What is class() of SUMPERSON1 and 2? What are size() of them?

Iniciar sesión para comentar.

Respuestas (1)

One of two possible causes.
  1. SUMPERSON2 is not a double (see this question for an example)
  2. 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;

Etiquetas

Preguntada:

el 25 de Sept. de 2020

Respondida:

el 25 de En. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by