How can I convert my code to the exe file?

2 views (last 30 days)
Gurkan Yilmaz
Gurkan Yilmaz on 29 Jan 2020
Edited: Mohammad Sami on 29 Jan 2020
Hello,
I created a application with app designer in Matlab. I want to convert it as like a exe file which is can play in everycomputer. But when I use the compiler in Matlab, it creates a exe file which is connected with runtime application. I cant download the runtime in everycompuer to work this exe file. Could you help me about this ?
classdef Pressure_Loss_exported < matlab.apps.AppBase
% Properties that correspond to app components
properties (Access = public)
UIFigure matlab.ui.Figure
FlowQEditFieldLabel matlab.ui.control.Label
FlowQEditField matlab.ui.control.NumericEditField
PipeOuterDiameterODEditFieldLabel matlab.ui.control.Label
PipeOuterDiameterODEditField matlab.ui.control.NumericEditField
PipeWallThicknesstEditFieldLabel matlab.ui.control.Label
PipeWallThicknesstEditField matlab.ui.control.NumericEditField
PipeLengthLEditFieldLabel matlab.ui.control.Label
PipeLengthLEditField matlab.ui.control.NumericEditField
PressureLossControlLabel matlab.ui.control.Label
SuddenContractionBEditFieldLabel matlab.ui.control.Label
SuddenContractionBEditField matlab.ui.control.NumericEditField
SuddenEnlargementBEditFieldLabel matlab.ui.control.Label
SuddenEnlargementBEditField matlab.ui.control.NumericEditField
AnalysisButton matlab.ui.control.Button
TotalLossEditFieldLabel matlab.ui.control.Label
TotalLossEditField matlab.ui.control.NumericEditField
SuddenContractionEditField_2Label matlab.ui.control.Label
SuddenContractionEditField_2 matlab.ui.control.NumericEditField
SuddenEnlargementEditField_2Label matlab.ui.control.Label
SuddenEnlargementEditField_2 matlab.ui.control.NumericEditField
GateValveEditFieldLabel matlab.ui.control.Label
GateValveEditField matlab.ui.control.NumericEditField
GlobeValveEditFieldLabel matlab.ui.control.Label
GlobeValveEditField matlab.ui.control.NumericEditField
AngleGlobeValveEditFieldLabel matlab.ui.control.Label
AngleGlobeValveEditField matlab.ui.control.NumericEditField
SwingCheckValveEditFieldLabel matlab.ui.control.Label
SwingCheckValveEditField matlab.ui.control.NumericEditField
LiftCheckValveEditFieldLabel matlab.ui.control.Label
LiftCheckValveEditField matlab.ui.control.NumericEditField
LCVSmoothPassageEditFieldLabel matlab.ui.control.Label
LCVSmoothPassageEditField matlab.ui.control.NumericEditField
TiltingDiscCheckValvesEditFieldLabel matlab.ui.control.Label
TiltingDiscCheckValvesEditField matlab.ui.control.NumericEditField
StopCheckValveEditFieldLabel matlab.ui.control.Label
StopCheckValveEditField matlab.ui.control.NumericEditField
AngleStopCheckValveEditFieldLabel matlab.ui.control.Label
AngleStopCheckValveEditField matlab.ui.control.NumericEditField
FVWithStrainerPoppetDiscEditFieldLabel matlab.ui.control.Label
FVWithStrainerPoppetDiscEditField matlab.ui.control.NumericEditField
FVWithStrainerHingedDiscEditFieldLabel matlab.ui.control.Label
FVWithStrainerHingedDiscEditField matlab.ui.control.NumericEditField
ButterflyValveEditFieldLabel matlab.ui.control.Label
ButterflyValveEditField matlab.ui.control.NumericEditField
WayValveThroughPassageEditFieldLabel matlab.ui.control.Label
WayValveThroughPassageEditField matlab.ui.control.NumericEditField
BallValveFullBoreEditFieldLabel matlab.ui.control.Label
BallValveFullBoreEditField matlab.ui.control.NumericEditField
WayValveRightPassageEditFieldLabel matlab.ui.control.Label
WayValveRightPassageEditField matlab.ui.control.NumericEditField
MitreBend15EditFieldLabel matlab.ui.control.Label
MitreBend15EditField matlab.ui.control.NumericEditField
MitreBend30EditFieldLabel matlab.ui.control.Label
MitreBend30EditField matlab.ui.control.NumericEditField
MitreBend45EditFieldLabel matlab.ui.control.Label
MitreBend45EditField matlab.ui.control.NumericEditField
MitreBend60EditFieldLabel matlab.ui.control.Label
MitreBend60EditField matlab.ui.control.NumericEditField
MitreBend75EditFieldLabel matlab.ui.control.Label
MitreBend75EditField matlab.ui.control.NumericEditField
MitreBend90EditFieldLabel matlab.ui.control.Label
MitreBend90EditField matlab.ui.control.NumericEditField
Elbow1DEditFieldLabel matlab.ui.control.Label
Elbow1DEditField matlab.ui.control.NumericEditField
ReturnBendEditFieldLabel matlab.ui.control.Label
ReturnBendEditField matlab.ui.control.NumericEditField
Elbow15DEditFieldLabel matlab.ui.control.Label
Elbow15DEditField matlab.ui.control.NumericEditField
TEEFlowThroughRunEditFieldLabel matlab.ui.control.Label
TEEFlowThroughRunEditField matlab.ui.control.NumericEditField
TEEFlowThroughBranchEditFieldLabel matlab.ui.control.Label
TEEFlowThroughBranchEditField matlab.ui.control.NumericEditField
PipeEntranceInwardProjectingEditFieldLabel matlab.ui.control.Label
PipeEntranceInwardProjectingEditField matlab.ui.control.NumericEditField
PipeEntranceFlushEditFieldLabel matlab.ui.control.Label
PipeEntranceFlushEditField matlab.ui.control.NumericEditField
OtherKfactorEditFieldLabel matlab.ui.control.Label
OtherKfactorEditField matlab.ui.control.NumericEditField
NumberLabel matlab.ui.control.Label
NumberLabel_2 matlab.ui.control.Label
NumberLabel_3 matlab.ui.control.Label
StaticHeadEditFieldLabel matlab.ui.control.Label
StaticHeadEditField matlab.ui.control.NumericEditField
UIAxes matlab.ui.control.UIAxes
byGurkanYilmazLabel matlab.ui.control.Label
barLabel matlab.ui.control.Label
m3hLabel matlab.ui.control.Label
mmLabel matlab.ui.control.Label
mmLabel_2 matlab.ui.control.Label
mLabel matlab.ui.control.Label
mLabel_2 matlab.ui.control.Label
end
% Callbacks that handle component events
methods (Access = private)
% Button pushed function: AnalysisButton
function AnalysisButtonPushed(app, event)
u = 1.044;
p = 1025;
q = app.FlowQEditField.Value;
od = app.PipeOuterDiameterODEditField.Value;
t = app.PipeWallThicknesstEditField.Value;
d = od-2*t;
L = app.PipeLengthLEditField.Value;
v = q/(3600*(d*0.001)^2*0.786);
re = 1000*v*d/u;
rop = 0.05;
k = rop/d;
f = 1/(-1.8*log10((6.9/re)+(k/3.7)^1.11))^2;
ft = 0.018;
scb = app.SuddenContractionBEditField.Value;
seb = app.SuddenEnlargementBEditField.Value;
sh = app.StaticHeadEditField.Value;
i = 0.5*(1-scb^2)/scb^4;
j = (1-seb^2)^2/seb^4;
sc = app.SuddenContractionEditField_2.Value;
se = app.SuddenEnlargementEditField_2.Value;
gtv = app.GateValveEditField.Value;
swingcv = app.SwingCheckValveEditField.Value;
gbv = app.GlobeValveEditField.Value;
agv = app.AngleGlobeValveEditField.Value;
lcv = app.LiftCheckValveEditField.Value;
lcvsp = app.LCVSmoothPassageEditField.Value;
tdcv = app.TiltingDiscCheckValvesEditField.Value;
stopcv = app.StopCheckValveEditField.Value;
ascv = app.AngleStopCheckValveEditField.Value;
fvspd = app.FVWithStrainerPoppetDiscEditField.Value;
fvshd = app.FVWithStrainerHingedDiscEditField.Value;
bvfb = app.BallValveFullBoreEditField.Value;
bv = app.ButterflyValveEditField.Value;
wtp = app.WayValveThroughPassageEditField.Value;
wrp = app.WayValveRightPassageEditField.Value;
mb15 = app.MitreBend15EditField.Value;
mb30 = app.MitreBend30EditField.Value;
mb45 = app.MitreBend45EditField.Value;
mb60 = app.MitreBend60EditField.Value;
mb75 = app.MitreBend75EditField.Value;
mb90 = app.MitreBend90EditField.Value;
elbow15 = app.Elbow15DEditField.Value;
elbow1 = app.Elbow1DEditField.Value;
rb = app.ReturnBendEditField.Value;
tftr = app.TEEFlowThroughRunEditField.Value;
tftb = app.TEEFlowThroughBranchEditField.Value;
pep = app.PipeEntranceInwardProjectingEditField.Value;
pef = app.PipeEntranceFlushEditField.Value;
other = app.OtherKfactorEditField.Value;
total = i*sc+j*se+0.14*gtv+0.9*swingcv+6.12*gbv+2.7*agv+...
10.8*lcv+0.99*lcvsp+0.72*tdcv+7.2*stopcv+3.6*ascv+...
7.56*fvspd+1.35*fvshd+0.05*bvfb+0.81*bv+0.54*wtp+...
1.62*wrp+0.07*mb15+0.14*mb30+0.27*mb45+0.45*mb60+...
0.72*mb75+1.08*mb90+0.25*elbow15+0.36*elbow1+0.9*rb+...
0.36*tftr+1.08*tftb+0.78*pep+0.5*pef+0.5*other;
fh = f*(L/(d*0.001))*(v^2/(2*9.81));
fih = total*v^2/(9.81*2);
th = sh+fh+fih;
totalloss = th*p*9.81/100000;
app.TotalLossEditField.Value = totalloss;
q1 = 140*100/q;
v1 = q1/(3600*(d*0.001)^2*0.786);
re1 = 1000*v1*d/u;
f1 = 1/(-1.8*log10((6.9/re1)+(k/3.7)^1.11))^2;
fh1 = f1*(L/(d*0.001))*(v1^2/(2*9.81));
fih1 = total*v1^2/(9.81*2);
th1 = sh+fh1+fih1;
totalloss1 = th1*p*9.81/100000;
q2 = 120*100/q;
v2 = q2/(3600*(d*0.001)^2*0.786);
re2 = 1000*v2*d/u;
f2 = 1/(-1.8*log10((6.9/re2)+(k/3.7)^1.11))^2;
fh2 = f2*(L/(d*0.001))*(v2^2/(2*9.81));
fih2 = total*v2^2/(9.81*2);
th2 = sh+fh2+fih2;
totalloss2 = th2*p*9.81/100000;
q3 = 80*100/q;
v3 = q3/(3600*(d*0.001)^2*0.786);
re3 = 1000*v3*d/u;
f3 = 1/(-1.8*log10((6.9/re3)+(k/3.7)^1.11))^2;
fh3 = f3*(L/(d*0.001))*(v3^2/(2*9.81));
fih3 = total*v3^2/(9.81*2);
th3 = sh+fh3+fih3;
totalloss3 = th3*p*9.81/100000;
q4 = 60*100/q;
v4 = q4/(3600*(d*0.001)^2*0.786);
re4 = 1000*v4*d/u;
f4 = 1/(-1.8*log10((6.9/re4)+(k/3.7)^1.11))^2;
fh4 = f4*(L/(d*0.001))*(v4^2/(2*9.81));
fih4 = total*v4^2/(9.81*2);
th4 = sh+fh4+fih4;
totalloss4 = th4*p*9.81/100000;
q5 = 40*100/q;
v5 = q5/(3600*(d*0.001)^2*0.786);
re5 = 1000*v5*d/u;
f5 = 1/(-1.8*log10((6.9/re5)+(k/3.7)^1.11))^2;
fh5 = f5*(L/(d*0.001))*(v5^2/(2*9.81));
fih5 = total*v5^2/(9.81*2);
th5 = sh+fh5+fih5;
totalloss5 = th5*p*9.81/100000;
zz = [q1 q2 q q3 q4 q5];
x = zz*q/100;
y = [totalloss1 totalloss2 totalloss totalloss3 totalloss4 totalloss5];
axis([0 160 0 1]);
plot(app.UIAxes,x,y);
end
end
% Component initialization
methods (Access = private)
% Create UIFigure and components
function createComponents(app)
% Create UIFigure and hide until all components are created
app.UIFigure = uifigure('Visible', 'off');
app.UIFigure.Position = [100 100 923 956];
app.UIFigure.Name = 'UI Figure';
% Create FlowQEditFieldLabel
app.FlowQEditFieldLabel = uilabel(app.UIFigure);
app.FlowQEditFieldLabel.HorizontalAlignment = 'right';
app.FlowQEditFieldLabel.Position = [129 864 51 22];
app.FlowQEditFieldLabel.Text = 'Flow (Q)';
% Create FlowQEditField
app.FlowQEditField = uieditfield(app.UIFigure, 'numeric');
app.FlowQEditField.Position = [195 864 100 22];
% Create PipeOuterDiameterODEditFieldLabel
app.PipeOuterDiameterODEditFieldLabel = uilabel(app.UIFigure);
app.PipeOuterDiameterODEditFieldLabel.HorizontalAlignment = 'right';
app.PipeOuterDiameterODEditFieldLabel.Position = [7 819 173 22];
app.PipeOuterDiameterODEditFieldLabel.Text = 'Pipe Outer Diameter (OD) ';
% Create PipeOuterDiameterODEditField
app.PipeOuterDiameterODEditField = uieditfield(app.UIFigure, 'numeric');
app.PipeOuterDiameterODEditField.Position = [195 819 100 22];
% Create PipeWallThicknesstEditFieldLabel
app.PipeWallThicknesstEditFieldLabel = uilabel(app.UIFigure);
app.PipeWallThicknesstEditFieldLabel.HorizontalAlignment = 'right';
app.PipeWallThicknesstEditFieldLabel.Position = [52 774 128 22];
app.PipeWallThicknesstEditFieldLabel.Text = 'Pipe Wall Thickness (t)';
% Create PipeWallThicknesstEditField
app.PipeWallThicknesstEditField = uieditfield(app.UIFigure, 'numeric');
app.PipeWallThicknesstEditField.Position = [195 774 100 22];
% Create PipeLengthLEditFieldLabel
app.PipeLengthLEditFieldLabel = uilabel(app.UIFigure);
app.PipeLengthLEditFieldLabel.HorizontalAlignment = 'right';
app.PipeLengthLEditFieldLabel.Position = [93 730 88 22];
app.PipeLengthLEditFieldLabel.Text = 'Pipe Length (L)';
% Create PipeLengthLEditField
app.PipeLengthLEditField = uieditfield(app.UIFigure, 'numeric');
app.PipeLengthLEditField.Position = [196 730 100 22];
% Create PressureLossControlLabel
app.PressureLossControlLabel = uilabel(app.UIFigure);
app.PressureLossControlLabel.FontSize = 24;
app.PressureLossControlLabel.FontWeight = 'bold';
app.PressureLossControlLabel.Position = [328 915 266 30];
app.PressureLossControlLabel.Text = 'Pressure Loss Control';
% Create SuddenContractionBEditFieldLabel
app.SuddenContractionBEditFieldLabel = uilabel(app.UIFigure);
app.SuddenContractionBEditFieldLabel.HorizontalAlignment = 'right';
app.SuddenContractionBEditFieldLabel.Position = [49 686 131 22];
app.SuddenContractionBEditFieldLabel.Text = 'Sudden Contraction (B)';
% Create SuddenContractionBEditField
app.SuddenContractionBEditField = uieditfield(app.UIFigure, 'numeric');
app.SuddenContractionBEditField.Position = [195 686 100 22];
% Create SuddenEnlargementBEditFieldLabel
app.SuddenEnlargementBEditFieldLabel = uilabel(app.UIFigure);
app.SuddenEnlargementBEditFieldLabel.HorizontalAlignment = 'right';
app.SuddenEnlargementBEditFieldLabel.Position = [42 642 138 22];
app.SuddenEnlargementBEditFieldLabel.Text = 'Sudden Enlargement (B)';
% Create SuddenEnlargementBEditField
app.SuddenEnlargementBEditField = uieditfield(app.UIFigure, 'numeric');
app.SuddenEnlargementBEditField.Position = [195 642 100 22];
% Create AnalysisButton
app.AnalysisButton = uibutton(app.UIFigure, 'push');
app.AnalysisButton.ButtonPushedFcn = createCallbackFcn(app, @AnalysisButtonPushed, true);
app.AnalysisButton.FontSize = 18;
app.AnalysisButton.FontWeight = 'bold';
app.AnalysisButton.Position = [112 485 189 66];
app.AnalysisButton.Text = 'Analysis';
% Create TotalLossEditFieldLabel
app.TotalLossEditFieldLabel = uilabel(app.UIFigure);
app.TotalLossEditFieldLabel.HorizontalAlignment = 'right';
app.TotalLossEditFieldLabel.FontSize = 18;
app.TotalLossEditFieldLabel.FontWeight = 'bold';
app.TotalLossEditFieldLabel.Position = [353 500 94 37];
app.TotalLossEditFieldLabel.Text = 'Total Loss';
% Create TotalLossEditField
app.TotalLossEditField = uieditfield(app.UIFigure, 'numeric');
app.TotalLossEditField.FontSize = 18;
app.TotalLossEditField.Position = [451 500 175 37];
% Create SuddenContractionEditField_2Label
app.SuddenContractionEditField_2Label = uilabel(app.UIFigure);
app.SuddenContractionEditField_2Label.HorizontalAlignment = 'right';
app.SuddenContractionEditField_2Label.Position = [42 415 112 22];
app.SuddenContractionEditField_2Label.Text = 'Sudden Contraction';
% Create SuddenContractionEditField_2
app.SuddenContractionEditField_2 = uieditfield(app.UIFigure, 'numeric');
app.SuddenContractionEditField_2.Position = [169 415 100 22];
% Create SuddenEnlargementEditField_2Label
app.SuddenEnlargementEditField_2Label = uilabel(app.UIFigure);
app.SuddenEnlargementEditField_2Label.HorizontalAlignment = 'right';
app.SuddenEnlargementEditField_2Label.Position = [36 378 118 22];
app.SuddenEnlargementEditField_2Label.Text = 'Sudden Enlargement';
% Create SuddenEnlargementEditField_2
app.SuddenEnlargementEditField_2 = uieditfield(app.UIFigure, 'numeric');
app.SuddenEnlargementEditField_2.Position = [169 378 100 22];
% Create GateValveEditFieldLabel
app.GateValveEditFieldLabel = uilabel(app.UIFigure);
app.GateValveEditFieldLabel.HorizontalAlignment = 'right';
app.GateValveEditFieldLabel.Position = [90 341 64 22];
app.GateValveEditFieldLabel.Text = 'Gate Valve';
% Create GateValveEditField
app.GateValveEditField = uieditfield(app.UIFigure, 'numeric');
app.GateValveEditField.Position = [169 341 100 22];
% Create GlobeValveEditFieldLabel
app.GlobeValveEditFieldLabel = uilabel(app.UIFigure);
app.GlobeValveEditFieldLabel.HorizontalAlignment = 'right';
app.GlobeValveEditFieldLabel.Position = [84 267 70 22];
app.GlobeValveEditFieldLabel.Text = 'Globe Valve';
% Create GlobeValveEditField
app.GlobeValveEditField = uieditfield(app.UIFigure, 'numeric');
app.GlobeValveEditField.Position = [169 267 100 22];
% Create AngleGlobeValveEditFieldLabel
app.AngleGlobeValveEditFieldLabel = uilabel(app.UIFigure);
app.AngleGlobeValveEditFieldLabel.HorizontalAlignment = 'right';
app.AngleGlobeValveEditFieldLabel.Position = [50 230 104 22];
app.AngleGlobeValveEditFieldLabel.Text = 'Angle Globe Valve';
% Create AngleGlobeValveEditField
app.AngleGlobeValveEditField = uieditfield(app.UIFigure, 'numeric');
app.AngleGlobeValveEditField.Position = [169 230 100 22];
% Create SwingCheckValveEditFieldLabel
app.SwingCheckValveEditFieldLabel = uilabel(app.UIFigure);
app.SwingCheckValveEditFieldLabel.HorizontalAlignment = 'right';
app.SwingCheckValveEditFieldLabel.Position = [46 304 108 22];
app.SwingCheckValveEditFieldLabel.Text = {'Swing Check Valve'; ''};
% Create SwingCheckValveEditField
app.SwingCheckValveEditField = uieditfield(app.UIFigure, 'numeric');
app.SwingCheckValveEditField.Position = [169 304 100 22];
% Create LiftCheckValveEditFieldLabel
app.LiftCheckValveEditFieldLabel = uilabel(app.UIFigure);
app.LiftCheckValveEditFieldLabel.HorizontalAlignment = 'right';
app.LiftCheckValveEditFieldLabel.Position = [63 193 91 22];
app.LiftCheckValveEditFieldLabel.Text = {'Lift Check Valve'; ''};
% Create LiftCheckValveEditField
app.LiftCheckValveEditField = uieditfield(app.UIFigure, 'numeric');
app.LiftCheckValveEditField.Position = [169 193 100 22];
% Create LCVSmoothPassageEditFieldLabel
app.LCVSmoothPassageEditFieldLabel = uilabel(app.UIFigure);
app.LCVSmoothPassageEditFieldLabel.HorizontalAlignment = 'right';
app.LCVSmoothPassageEditFieldLabel.Position = [22 156 132 22];
app.LCVSmoothPassageEditFieldLabel.Text = {'L.C.V. Smooth Passage'; ''};
% Create LCVSmoothPassageEditField
app.LCVSmoothPassageEditField = uieditfield(app.UIFigure, 'numeric');
app.LCVSmoothPassageEditField.Position = [169 156 100 22];
% Create TiltingDiscCheckValvesEditFieldLabel
app.TiltingDiscCheckValvesEditFieldLabel = uilabel(app.UIFigure);
app.TiltingDiscCheckValvesEditFieldLabel.HorizontalAlignment = 'right';
app.TiltingDiscCheckValvesEditFieldLabel.Position = [14 120 140 22];
app.TiltingDiscCheckValvesEditFieldLabel.Text = {'Tilting Disc Check Valves'; ''};
% Create TiltingDiscCheckValvesEditField
app.TiltingDiscCheckValvesEditField = uieditfield(app.UIFigure, 'numeric');
app.TiltingDiscCheckValvesEditField.Position = [169 120 100 22];
% Create StopCheckValveEditFieldLabel
app.StopCheckValveEditFieldLabel = uilabel(app.UIFigure);
app.StopCheckValveEditFieldLabel.HorizontalAlignment = 'right';
app.StopCheckValveEditFieldLabel.Position = [54 84 100 22];
app.StopCheckValveEditFieldLabel.Text = {'Stop Check Valve'; ''};
% Create StopCheckValveEditField
app.StopCheckValveEditField = uieditfield(app.UIFigure, 'numeric');
app.StopCheckValveEditField.Position = [169 84 100 22];
% Create AngleStopCheckValveEditFieldLabel
app.AngleStopCheckValveEditFieldLabel = uilabel(app.UIFigure);
app.AngleStopCheckValveEditFieldLabel.HorizontalAlignment = 'right';
app.AngleStopCheckValveEditFieldLabel.Position = [339 415 134 22];
app.AngleStopCheckValveEditFieldLabel.Text = {'Angle Stop Check Valve'; ''};
% Create AngleStopCheckValveEditField
app.AngleStopCheckValveEditField = uieditfield(app.UIFigure, 'numeric');
app.AngleStopCheckValveEditField.Position = [488 415 100 22];
% Create FVWithStrainerPoppetDiscEditFieldLabel
app.FVWithStrainerPoppetDiscEditFieldLabel = uilabel(app.UIFigure);
app.FVWithStrainerPoppetDiscEditFieldLabel.HorizontalAlignment = 'right';
app.FVWithStrainerPoppetDiscEditFieldLabel.Position = [304 378 169 22];
app.FVWithStrainerPoppetDiscEditFieldLabel.Text = {'F. V. With Strainer Poppet Disc'; ''};
% Create FVWithStrainerPoppetDiscEditField
app.FVWithStrainerPoppetDiscEditField = uieditfield(app.UIFigure, 'numeric');
app.FVWithStrainerPoppetDiscEditField.Position = [488 378 100 22];
% Create FVWithStrainerHingedDiscEditFieldLabel
app.FVWithStrainerHingedDiscEditFieldLabel = uilabel(app.UIFigure);
app.FVWithStrainerHingedDiscEditFieldLabel.HorizontalAlignment = 'right';
app.FVWithStrainerHingedDiscEditFieldLabel.Position = [304 341 169 22];
app.FVWithStrainerHingedDiscEditFieldLabel.Text = {'F. V. With Strainer Hinged Disc'; ''};
% Create FVWithStrainerHingedDiscEditField
app.FVWithStrainerHingedDiscEditField = uieditfield(app.UIFigure, 'numeric');
app.FVWithStrainerHingedDiscEditField.Position = [488 341 100 22];
% Create ButterflyValveEditFieldLabel
app.ButterflyValveEditFieldLabel = uilabel(app.UIFigure);
app.ButterflyValveEditFieldLabel.HorizontalAlignment = 'right';
app.ButterflyValveEditFieldLabel.Position = [391 267 82 22];
app.ButterflyValveEditFieldLabel.Text = {'Butterfly Valve'; ''};
% Create ButterflyValveEditField
app.ButterflyValveEditField = uieditfield(app.UIFigure, 'numeric');
app.ButterflyValveEditField.Position = [488 267 100 22];
% Create WayValveThroughPassageEditFieldLabel
app.WayValveThroughPassageEditFieldLabel = uilabel(app.UIFigure);
app.WayValveThroughPassageEditFieldLabel.HorizontalAlignment = 'right';
app.WayValveThroughPassageEditFieldLabel.Position = [303 230 170 22];
app.WayValveThroughPassageEditFieldLabel.Text = {'3-Way Valve Through Passage'; ''};
% Create WayValveThroughPassageEditField
app.WayValveThroughPassageEditField = uieditfield(app.UIFigure, 'numeric');
app.WayValveThroughPassageEditField.Position = [488 230 100 22];
% Create BallValveFullBoreEditFieldLabel
app.BallValveFullBoreEditFieldLabel = uilabel(app.UIFigure);
app.BallValveFullBoreEditFieldLabel.HorizontalAlignment = 'right';
app.BallValveFullBoreEditFieldLabel.Position = [364 304 109 22];
app.BallValveFullBoreEditFieldLabel.Text = {'Ball Valve Full Bore'; ''};
% Create BallValveFullBoreEditField
app.BallValveFullBoreEditField = uieditfield(app.UIFigure, 'numeric');
app.BallValveFullBoreEditField.Position = [488 304 100 22];
% Create WayValveRightPassageEditFieldLabel
app.WayValveRightPassageEditFieldLabel = uilabel(app.UIFigure);
app.WayValveRightPassageEditFieldLabel.HorizontalAlignment = 'right';
app.WayValveRightPassageEditFieldLabel.Position = [319 193 154 22];
app.WayValveRightPassageEditFieldLabel.Text = {'3-Way Valve Right Passage'; ''};
% Create WayValveRightPassageEditField
app.WayValveRightPassageEditField = uieditfield(app.UIFigure, 'numeric');
app.WayValveRightPassageEditField.Position = [488 193 100 22];
% Create MitreBend15EditFieldLabel
app.MitreBend15EditFieldLabel = uilabel(app.UIFigure);
app.MitreBend15EditFieldLabel.HorizontalAlignment = 'right';
app.MitreBend15EditFieldLabel.Position = [388 156 85 22];
app.MitreBend15EditFieldLabel.Text = {'Mitre Bend 15°'; ''};
% Create MitreBend15EditField
app.MitreBend15EditField = uieditfield(app.UIFigure, 'numeric');
app.MitreBend15EditField.Position = [488 156 100 22];
% Create MitreBend30EditFieldLabel
app.MitreBend30EditFieldLabel = uilabel(app.UIFigure);
app.MitreBend30EditFieldLabel.HorizontalAlignment = 'right';
app.MitreBend30EditFieldLabel.Position = [388 120 85 22];
app.MitreBend30EditFieldLabel.Text = {'Mitre Bend 30°'; ''};
% Create MitreBend30EditField
app.MitreBend30EditField = uieditfield(app.UIFigure, 'numeric');
app.MitreBend30EditField.Position = [488 120 100 22];
% Create MitreBend45EditFieldLabel
app.MitreBend45EditFieldLabel = uilabel(app.UIFigure);
app.MitreBend45EditFieldLabel.HorizontalAlignment = 'right';
app.MitreBend45EditFieldLabel.Position = [388 84 85 22];
app.MitreBend45EditFieldLabel.Text = {'Mitre Bend 45°'; ''};
% Create MitreBend45EditField
app.MitreBend45EditField = uieditfield(app.UIFigure, 'numeric');
app.MitreBend45EditField.Position = [488 84 100 22];
% Create MitreBend60EditFieldLabel
app.MitreBend60EditFieldLabel = uilabel(app.UIFigure);
app.MitreBend60EditFieldLabel.HorizontalAlignment = 'right';
app.MitreBend60EditFieldLabel.Position = [693 415 85 22];
app.MitreBend60EditFieldLabel.Text = {'Mitre Bend 60°'; ''};
% Create MitreBend60EditField
app.MitreBend60EditField = uieditfield(app.UIFigure, 'numeric');
app.MitreBend60EditField.Position = [793 415 100 22];
% Create MitreBend75EditFieldLabel
app.MitreBend75EditFieldLabel = uilabel(app.UIFigure);
app.MitreBend75EditFieldLabel.HorizontalAlignment = 'right';
app.MitreBend75EditFieldLabel.Position = [693 378 85 22];
app.MitreBend75EditFieldLabel.Text = {'Mitre Bend 75°'; ''};
% Create MitreBend75EditField
app.MitreBend75EditField = uieditfield(app.UIFigure, 'numeric');
app.MitreBend75EditField.Position = [793 378 100 22];
% Create MitreBend90EditFieldLabel
app.MitreBend90EditFieldLabel = uilabel(app.UIFigure);
app.MitreBend90EditFieldLabel.HorizontalAlignment = 'right';
app.MitreBend90EditFieldLabel.Position = [693 341 85 22];
app.MitreBend90EditFieldLabel.Text = {'Mitre Bend 90°'; ''};
% Create MitreBend90EditField
app.MitreBend90EditField = uieditfield(app.UIFigure, 'numeric');
app.MitreBend90EditField.Position = [793 341 100 22];
% Create Elbow1DEditFieldLabel
app.Elbow1DEditFieldLabel = uilabel(app.UIFigure);
app.Elbow1DEditFieldLabel.HorizontalAlignment = 'right';
app.Elbow1DEditFieldLabel.Position = [721 267 57 22];
app.Elbow1DEditFieldLabel.Text = {'Elbow 1D'; ''};
% Create Elbow1DEditField
app.Elbow1DEditField = uieditfield(app.UIFigure, 'numeric');
app.Elbow1DEditField.Position = [793 267 100 22];
% Create ReturnBendEditFieldLabel
app.ReturnBendEditFieldLabel = uilabel(app.UIFigure);
app.ReturnBendEditFieldLabel.HorizontalAlignment = 'right';
app.ReturnBendEditFieldLabel.Position = [705 230 73 22];
app.ReturnBendEditFieldLabel.Text = {'Return Bend'; ''};
% Create ReturnBendEditField
app.ReturnBendEditField = uieditfield(app.UIFigure, 'numeric');
app.ReturnBendEditField.Position = [793 230 100 22];
% Create Elbow15DEditFieldLabel
app.Elbow15DEditFieldLabel = uilabel(app.UIFigure);
app.Elbow15DEditFieldLabel.HorizontalAlignment = 'right';
app.Elbow15DEditFieldLabel.Position = [711 304 67 22];
app.Elbow15DEditFieldLabel.Text = {'Elbow 1.5D'; ''};
% Create Elbow15DEditField
app.Elbow15DEditField = uieditfield(app.UIFigure, 'numeric');
app.Elbow15DEditField.Position = [793 304 100 22];
% Create TEEFlowThroughRunEditFieldLabel
app.TEEFlowThroughRunEditFieldLabel = uilabel(app.UIFigure);
app.TEEFlowThroughRunEditFieldLabel.HorizontalAlignment = 'right';
app.TEEFlowThroughRunEditFieldLabel.Position = [647 193 131 22];
app.TEEFlowThroughRunEditFieldLabel.Text = 'TEE Flow Through Run';
% Create TEEFlowThroughRunEditField
app.TEEFlowThroughRunEditField = uieditfield(app.UIFigure, 'numeric');
app.TEEFlowThroughRunEditField.Position = [793 193 100 22];
% Create TEEFlowThroughBranchEditFieldLabel
app.TEEFlowThroughBranchEditFieldLabel = uilabel(app.UIFigure);
app.TEEFlowThroughBranchEditFieldLabel.HorizontalAlignment = 'right';
app.TEEFlowThroughBranchEditFieldLabel.Position = [631 156 147 22];
app.TEEFlowThroughBranchEditFieldLabel.Text = {'TEE Flow Through Branch'; ''};
% Create TEEFlowThroughBranchEditField
app.TEEFlowThroughBranchEditField = uieditfield(app.UIFigure, 'numeric');
app.TEEFlowThroughBranchEditField.Position = [793 156 100 22];
% Create PipeEntranceInwardProjectingEditFieldLabel
app.PipeEntranceInwardProjectingEditFieldLabel = uilabel(app.UIFigure);
app.PipeEntranceInwardProjectingEditFieldLabel.HorizontalAlignment = 'right';
app.PipeEntranceInwardProjectingEditFieldLabel.Position = [611 120 177 22];
app.PipeEntranceInwardProjectingEditFieldLabel.Text = {'Pipe Entrance Inward Projecting'; ''};
% Create PipeEntranceInwardProjectingEditField
app.PipeEntranceInwardProjectingEditField = uieditfield(app.UIFigure, 'numeric');
app.PipeEntranceInwardProjectingEditField.Position = [793 120 100 22];
% Create PipeEntranceFlushEditFieldLabel
app.PipeEntranceFlushEditFieldLabel = uilabel(app.UIFigure);
app.PipeEntranceFlushEditFieldLabel.HorizontalAlignment = 'right';
app.PipeEntranceFlushEditFieldLabel.Position = [664 84 114 22];
app.PipeEntranceFlushEditFieldLabel.Text = {'Pipe Entrance Flush'; ''};
% Create PipeEntranceFlushEditField
app.PipeEntranceFlushEditField = uieditfield(app.UIFigure, 'numeric');
app.PipeEntranceFlushEditField.Position = [793 84 100 22];
% Create OtherKfactorEditFieldLabel
app.OtherKfactorEditFieldLabel = uilabel(app.UIFigure);
app.OtherKfactorEditFieldLabel.HorizontalAlignment = 'right';
app.OtherKfactorEditFieldLabel.Position = [389 44 85 22];
app.OtherKfactorEditFieldLabel.Text = {'Other ''K'' factor'; ''};
% Create OtherKfactorEditField
app.OtherKfactorEditField = uieditfield(app.UIFigure, 'numeric');
app.OtherKfactorEditField.Position = [489 44 100 22];
% Create NumberLabel
app.NumberLabel = uilabel(app.UIFigure);
app.NumberLabel.FontWeight = 'bold';
app.NumberLabel.Position = [194 437 51 22];
app.NumberLabel.Text = 'Number';
% Create NumberLabel_2
app.NumberLabel_2 = uilabel(app.UIFigure);
app.NumberLabel_2.FontWeight = 'bold';
app.NumberLabel_2.Position = [508 437 51 22];
app.NumberLabel_2.Text = 'Number';
% Create NumberLabel_3
app.NumberLabel_3 = uilabel(app.UIFigure);
app.NumberLabel_3.FontWeight = 'bold';
app.NumberLabel_3.Position = [818 437 51 22];
app.NumberLabel_3.Text = 'Number';
% Create StaticHeadEditFieldLabel
app.StaticHeadEditFieldLabel = uilabel(app.UIFigure);
app.StaticHeadEditFieldLabel.HorizontalAlignment = 'right';
app.StaticHeadEditFieldLabel.Position = [112 598 68 22];
app.StaticHeadEditFieldLabel.Text = 'Static Head';
% Create StaticHeadEditField
app.StaticHeadEditField = uieditfield(app.UIFigure, 'numeric');
app.StaticHeadEditField.Position = [195 598 100 22];
% Create UIAxes
app.UIAxes = uiaxes(app.UIFigure);
title(app.UIAxes, 'Pressure Loss')
xlabel(app.UIAxes, 'Pump-Efficient')
ylabel(app.UIAxes, 'Total-Loss')
app.UIAxes.Position = [353 582 540 304];
% Create byGurkanYilmazLabel
app.byGurkanYilmazLabel = uilabel(app.UIFigure);
app.byGurkanYilmazLabel.FontWeight = 'bold';
app.byGurkanYilmazLabel.FontAngle = 'italic';
app.byGurkanYilmazLabel.FontColor = [0.502 0.502 0.502];
app.byGurkanYilmazLabel.Position = [797 1 106 22];
app.byGurkanYilmazLabel.Text = 'by Gurkan Yilmaz';
% Create barLabel
app.barLabel = uilabel(app.UIFigure);
app.barLabel.Position = [632 507 25 22];
app.barLabel.Text = 'bar';
% Create m3hLabel
app.m3hLabel = uilabel(app.UIFigure);
app.m3hLabel.Position = [300 864 32 22];
app.m3hLabel.Text = 'm3/h';
% Create mmLabel
app.mmLabel = uilabel(app.UIFigure);
app.mmLabel.Position = [300 819 25 22];
app.mmLabel.Text = 'mm';
% Create mmLabel_2
app.mmLabel_2 = uilabel(app.UIFigure);
app.mmLabel_2.Position = [300 774 25 22];
app.mmLabel_2.Text = 'mm';
% Create mLabel
app.mLabel = uilabel(app.UIFigure);
app.mLabel.Position = [300 730 25 22];
app.mLabel.Text = 'm';
% Create mLabel_2
app.mLabel_2 = uilabel(app.UIFigure);
app.mLabel_2.Position = [300 598 25 22];
app.mLabel_2.Text = 'm';
% Show the figure after all components are created
app.UIFigure.Visible = 'on';
end
end
% App creation and deletion
methods (Access = public)
% Construct app
function app = Pressure_Loss_exported
% Create UIFigure and components
createComponents(app)
% Register the app with App Designer
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
% Code that executes before app deletion
function delete(app)
% Delete UIFigure when app is deleted
delete(app.UIFigure)
end
end
end

Answers (1)

Mohammad Sami
Mohammad Sami on 29 Jan 2020
If the user do not have admin rights, you can use the following workaround.
I have tested this in Win10, but the system has Matlab installed, so can't verify for those without Matlab.
Step 1
Install Matlab Runtime on a computer that you have admin access.
Step 2
Goto program files, matlab runtime and look for folder vXX. XX is the version of Matlab.
R2019b is v97.
Zip this folder.
Step 3
Unzip this folder on a non admin access directory on the target machine.
Step 4
In windows search type "Edit the environmental variables for your account"
Step 5
Click the variable called path and click edit.
Step 6
Click New and type in the path to Matlab Runtime
Path_to_the_folder_with_runtime\v97\runtime\win64
  2 Comments
Gurkan Yilmaz
Gurkan Yilmaz on 29 Jan 2020
Firstly, thank you very much for attention.
Do you have an idea to convert with Matlab Coder App. I read some informations about in internet and I tried but unfortunetly I couldnt convert again. I will share this document to many computer in my office. Your way looks like so good but computer number is too high :D
Because of this reason I want to convert to exe file directly. Could I convert it to Phyton ? Maybe later I can transform it to exe file from Phyton.
And Extra :D
I am sorry but I want to ask, Can I use my Matlab or Phyton document in Autocad ?
(Autocad 2020 has a new speciality about the uploading codes in Analysis Option)
Thank you very much again.
Kind Regards
Mohammad Sami
Mohammad Sami on 29 Jan 2020
Edited: Mohammad Sami on 29 Jan 2020
I think you can probably automate it with a batch script.
Essentially its an unzip command, you can probably create a folder in D drive, assuming most computer have it. Unzip it in that folder. Ref https://superuser.com/questions/1314420/how-to-unzip-a-file-using-the-cmd
Then a command to add to the User path variable Ref https://www.windows-commandline.com/set-path-command-line/
I have no experience in Autocad or Matlab Coder.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing 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!