Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Programacion
Programacion
AppBase
UIFigure matlab.ui.Figure
r2mEditFieldLabel matlab.ui.control.Label
r2 matlab.ui.control.NumericEditField
MECANISMOEMPUJAPAQUETESLabel matlab.ui.control.Label
DATOSDEENTRADALabel matlab.ui.control.Label
DATOSDESALIDALabel matlab.ui.control.Label
r3mEditFieldLabel matlab.ui.control.Label
r3 matlab.ui.control.NumericEditField
r4mEditFieldLabel matlab.ui.control.Label
r4 matlab.ui.control.NumericEditField
r7mEditFieldLabel matlab.ui.control.Label
r7 matlab.ui.control.NumericEditField
Image matlab.ui.control.Image
r5mEditFieldLabel matlab.ui.control.Label
r5 matlab.ui.control.NumericEditField
r1mEditFieldLabel matlab.ui.control.Label
r1 matlab.ui.control.NumericEditField
w2RPMEditFieldLabel matlab.ui.control.Label
w2 matlab.ui.control.NumericEditField
teta2EditFieldLabel matlab.ui.control.Label
teta2 matlab.ui.control.NumericEditField
r6mEditFieldLabel matlab.ui.control.Label
r6 matlab.ui.control.NumericEditField
w5radsEditFieldLabel matlab.ui.control.Label
w5 matlab.ui.control.NumericEditField
teta5EditFieldLabel matlab.ui.control.Label
teta5 matlab.ui.control.NumericEditField
VDmsEditFieldLabel matlab.ui.control.Label
vd matlab.ui.control.NumericEditField
CALCULARButton matlab.ui.control.Button
GRFICASButton matlab.ui.control.Button
end
r2 = app.r2.Value;
r1 = app.r1.Value;
r3 = app.r3.Value;
r4 = app.r4.Value;
r5 = app.r5.Value;
r7 = app.r7.Value;
w = app.w2.Value;
w2 = w*2*pi/60;
%lazo vectorial 1
k1 = r1/r2;
k2 = r1/r4;
k3 = (r1^2+r2^2+r3^2+r4^2)/(2*r2*r4);
k4 = r1/r3;
k5 = (r4^2-r1^2-r2^2-r3^2)/(2*r2*r3);
A = cosd(teta2)-k1-k2*cosd(teta2)+k3;
B = -2*sind(teta2);
C = k1-(k2+1)*cosd(teta2)+k3;
D = cosd(teta2)-k1-k4*cosd(teta2)+k5;
E = -2*sind(teta2);
F = k1-(k4-1)*cosd(teta2)+k5;
teta30 = 2*atand((-E-sqrt(E^2-4*D*F))/(2*D));
teta40 = 2*atand((-B-sqrt(B^2-4*A*C))/(2*A));
teta3 = teta30-28.39;
teta4 = teta40-28.39;
teta5 = asind((r2*sind(teta2)+r3*sind(teta3)+r7*sind(teta7)-r1)/r5);
r6 = r5*cosd(teta5)-r2*cosd(teta2)-r3*cosd(teta3)-r7*cosd(teta7);
w4 = (r2*w2*cosd(teta2)+r3*w2*cosd(teta3))/(r4*cosd(teta4));
w7 = w4;
w5 = (r2*w2*cosd(teta2)+r3*w3*cosd(teta3)+r7*w7*cosd(teta7))/(r5*cosd(teta5));
vd = r2*w2*sind(teta2)+r3*w3*sind(teta3)+r7*w7*sind(teta7)-r5*w5*sind(teta5);
%datos de salida
app.teta5.Value = teta5;
app.r6.Value = r6;
app.w5.Value = w5;
app.vd.Value = vd;
end
end
% Component initialization
function createComponents(app)
app.r2mEditFieldLabel = uilabel(app.UIFigure);
app.r2mEditFieldLabel.HorizontalAlignment = 'right';
% Create r2
app.r2.Editable = 'off';
app.r2.Value = 0.1;
% Create MECANISMOEMPUJAPAQUETESLabel
app.MECANISMOEMPUJAPAQUETESLabel = uilabel(app.UIFigure);
% Create DATOSDEENTRADALabel
app.DATOSDEENTRADALabel = uilabel(app.UIFigure);
% Create DATOSDESALIDALabel
app.DATOSDESALIDALabel = uilabel(app.UIFigure);
% Create r3mEditFieldLabel
app.r3mEditFieldLabel = uilabel(app.UIFigure);
app.r3mEditFieldLabel.HorizontalAlignment = 'right';
% Create r3
app.r3.Editable = 'off';
app.r3.Value = 0.4;
% Create r4mEditFieldLabel
app.r4mEditFieldLabel = uilabel(app.UIFigure);
app.r4mEditFieldLabel.HorizontalAlignment = 'right';
% Create r4
app.r4.Editable = 'off';
app.r4.Value = 0.3;
% Create r7mEditFieldLabel
app.r7mEditFieldLabel = uilabel(app.UIFigure);
app.r7mEditFieldLabel.HorizontalAlignment = 'right';
% Create r7
app.r7 = uieditfield(app.UIFigure, 'numeric');
app.r7.Editable = 'off';
app.r7.Value = 0.32;
% Create Image
app.Image = uiimage(app.UIFigure);
% Create r5mEditFieldLabel
app.r5mEditFieldLabel = uilabel(app.UIFigure);
app.r5mEditFieldLabel.HorizontalAlignment = 'right';
% Create r5
app.r5.Editable = 'off';
app.r5.Value = 0.65;
% Create r1mEditFieldLabel
app.r1mEditFieldLabel = uilabel(app.UIFigure);
app.r1mEditFieldLabel.HorizontalAlignment = 'right';
% Create r1
app.r1.Value = 0.3;
% Create w2RPMEditFieldLabel
app.w2RPMEditFieldLabel = uilabel(app.UIFigure);
app.w2RPMEditFieldLabel.HorizontalAlignment = 'right';
% Create w2
% Create teta2EditFieldLabel
app.teta2EditFieldLabel = uilabel(app.UIFigure);
app.teta2EditFieldLabel.HorizontalAlignment = 'right';
% Create teta2
% Create r6mEditFieldLabel
app.r6mEditFieldLabel = uilabel(app.UIFigure);
app.r6mEditFieldLabel.HorizontalAlignment = 'right';
% Create w5radsEditFieldLabel
app.w5radsEditFieldLabel = uilabel(app.UIFigure);
app.w5radsEditFieldLabel.HorizontalAlignment = 'right';
% Create w5
% Create teta5EditFieldLabel
app.teta5EditFieldLabel = uilabel(app.UIFigure);
app.teta5EditFieldLabel.HorizontalAlignment = 'right';
% Create teta5
% Create VDmsEditFieldLabel
app.VDmsEditFieldLabel = uilabel(app.UIFigure);
app.VDmsEditFieldLabel.HorizontalAlignment = 'right';
% Create vd
% Create CALCULARButton
app.CALCULARButton.ButtonPushedFcn = createCallbackFcn(app,
@CALCULARButtonPushed, true);
app.CALCULARButton.Text = 'CALCULAR';
% Create GRFICASButton
app.GRFICASButton.Text = 'GRÁFICAS';
app.UIFigure.Visible = 'on';
end
end
% Construct app
createComponents(app)
registerApp(app, app.UIFigure)
if nargout == 0
clear app
end
end
function delete(app)
delete(app.UIFigure)
end
end
end