Error setting property 'ReresultEditField' of class 'app1'. Cannot convert double value NaN to a handle

7 views (last 30 days)
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
RenumbercalculatorPanel matlab.ui.container.Panel
Densitykgm3EditFieldLabel matlab.ui.control.Label
Densitykgm3EditField matlab.ui.control.NumericEditField
VelocitymsEditFieldLabel matlab.ui.control.Label
VelocitymsEditField matlab.ui.control.NumericEditField
DiametermEditFieldLabel matlab.ui.control.Label
DiametermEditField matlab.ui.control.NumericEditField
dynamicviscosityNsm2EditFieldLabel matlab.ui.control.Label
dynamicviscosityNsm2EditField matlab.ui.control.NumericEditField
calculateButton matlab.ui.control.Button
ReresultEditFieldLabel matlab.ui.control.Label
ReresultEditField matlab.ui.control.NumericEditField
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: calculateButton
function calculateButtonPushed(app, event)
p = app.Densitykgm3EditField.Value;
V = app.VelocitymsEditField.Value;
D = app.DiametermEditField.Value;
u = app.dynamicviscosityNsm2EditField.Value;
%reynolds number function
Re = (p*V*D)/u;
app.ReresultEditField = Re;
end
end

Answers (1)

Mario Malic
Mario Malic on 1 Dec 2020
Set the component property this way
app.ReresultEditField.Value = Re;

Categories

Find more on Develop uifigure-Based 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!