Error setting property 'ReresultEditField' of class 'app1'. Cannot convert double value NaN to a handle
1 次查看(过去 30 天)
显示 更早的评论
% 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
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!