Error setting property 'ReresultEditField' of class 'app1'. Cannot convert double value NaN to a handle
8 ビュー (過去 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 件)
Mario Malic
2020 年 12 月 1 日
Set the component property this way
app.ReresultEditField.Value = Re;
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Develop uifigure-Based Apps についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!