MATLAB: Converting double to a handle

double

When I run the app designer, I keep getting the error
Error setting property 'EditField' of class 'Name0fGui':
Cannot convert double value 2 to a handle
Here is the code
properties (Access = private)
counter1=0 % Description

counter2=0 % Description
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: Button
function ButtonPushed(app, event)
value1=app.ChestPainCheckBox.Value;
if value1==1
app.counter1=app.counter1+1;
else
app.counter1=app.counter1;
end
value2=app.LuckyDipMaCheckBox.Value;
if value2==1
app.counter2=app.counter2+1;
else
app.counter2=app.counter2;
end
value3=app.AbrosyeCheckBox.Value;
if value3==1
app.counter1=app.counter1+1;
else
app.counter1=app.counter1;
end
value4=app.UnclemidadaCheckBox.Value;
if value4==1
app.counter2=app.counter2+1;
else
app.counter2=app.counter2;
end
app.EditField=app.counter1;
app.EditField2=app.counter2;
end
end

Best Answer

Try
app.EditField.Value = app.counter1;
app.EditField2.Value = app.counter2;
% ^^^^^^
If that doesn't fix the problem, please provide the entire error message and point to the line that is causing the error.