You are on page 1of 11

SOFTWARE APLICADO A LA INGENIERIA

ALUMNO: OMAR ALONSO BARRANTES ZUÑIGA


CUI:20160673 SECCION:”A”
function varargout = graficador(varargin)
% GRAFICADOR MATLAB code for graficador.fig
% GRAFICADOR, by itself, creates a new GRAFICADOR or raises the
existing
% singleton*.
%
% H = GRAFICADOR returns the handle to a new GRAFICADOR or the
handle to
% the existing singleton*.
%
% GRAFICADOR('CALLBACK',hObject,eventData,handles,...) calls the
local
% function named CALLBACK in GRAFICADOR.M with the given input
arguments.
%
% GRAFICADOR('Property','Value',...) creates a new GRAFICADOR or
raises the
% existing singleton*. Starting from the left, property value
pairs are
% applied to the GUI before graficador_OpeningFcn gets called.
An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to graficador_OpeningFcn via
varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows
only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help graficador

% Last Modified by GUIDE v2.5 04-Jan-2018 19:08:44

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @graficador_OpeningFcn, ...
'gui_OutputFcn', @graficador_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before graficador is made visible.


function graficador_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to graficador (see VARARGIN)
electricidad = imread('electricidad.jpg');
axes(handles.electricidad);
axis off;
imshow(electricidad);

% Choose default command line output for graficador


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes graficador wait for user response (see UIRESUME)


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = graficador_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

% --- Executes on button press in surf_pushbutton.


function surf_pushbutton_Callback(hObject, eventdata, handles)
% hObject handle to surf_pushbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in mesh_pushbutton.


function mesh_pushbutton_Callback(hObject, eventdata, handles)
% hObject handle to mesh_pushbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in contour_pushbutton.


function contour_pushbutton_Callback(hObject, eventdata, handles)
% hObject handle to contour_pushbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on selection change in data_popupmenu.
function data_popupmenu_Callback(hObject, eventdata, handles)
% hObject handle to data_popupmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns


data_popupmenu contents as cell array
% contents{get(hObject,'Value')} returns selected item from
data_popupmenu

% --- Executes during object creation, after setting all properties.

opcion = get(handles.data_popupmenu,'value');
switch opcion
case 1 % cuando el movimiento parabolico es de un angulo menor a
45 grados
v = 120
a = 26
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 2 %cuando el movimiento parabolico es de un angulo de 45
grados
v = 120
a = 45
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 3 %cuando movimiento parabolico con un angulo mayor de 45
grados
v = 120
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 4 %cuando el movimiento parabolico con una angulo menor de
90 grados
v = 120
a = 70
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 5 % cuando el movimiento parabolico con un angulo de 90
grados
v = 120
a = 90
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 6 %cuando el movimiento parabolico con un angulo mayor a 90
grados
v = 120
a = 110
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 7 %cuando el movimiento parabolico es 180 grados
v = 120
a = 180
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
end

function data_popupmenu_CreateFcn(hObject, eventdata, handles)


% hObject handle to data_popupmenu (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: popupmenu controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes during object creation, after setting all properties.


function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: place code in OpeningFcn to populate axes1

% --- Executes on selection change in popupmenu2.


function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2


contents as cell array
% contents{get(hObject,'Value')} returns selected item from
popupmenu2

% --- Executes during object creation, after setting all properties.


opcion2 = get(handles.popumenu2,'value');
switch opcion2
case 1 % cuando el movimiento parabolico es de un angulo menor a
90 grados
v = 50
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 2 %cuando el movimiento parabolico es de un angulo de 45
grados
v = 100
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 3 %cuando movimiento parabolico con un angulo mayor a 90
grados
v = 200
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
case 4
v = 250
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid

end
function popupmenu2_CreateFcn(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called

% Hint: popupmenu controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- If Enable == 'on', executes on mouse press in 5 pixel border.


% --- Otherwise, executes on mouse press in 5 pixel border or over
text1.
function text1_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to text1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- If Enable == 'on', executes on mouse press in 5 pixel border.


% --- Otherwise, executes on mouse press in 5 pixel border or over
text3.
function text3_ButtonDownFcn(hObject, eventdata, handles)
% hObject handle to text3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in VELO1.


function VELO1_Callback(hObject, eventdata, handles)
% hObject handle to VELO1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in VELO2.


v = 50
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid

function VELO2_Callback(hObject, eventdata, handles)


% hObject handle to VELO2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in VELO3.


v = 100
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
function VELO3_Callback(hObject, eventdata, handles)
% hObject handle to VELO3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in VELO4.


v = 150
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
function VELO4_Callback(hObject, eventdata, handles)
% hObject handle to VELO4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton8.
v = 200
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
function pushbutton8_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in VELO6.


v = 250
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
function VELO6_Callback(hObject, eventdata, handles)
% hObject handle to VELO6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton10.


v = 300
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid
function pushbutton10_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton10 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
v = 350
a = 53
g = 9.81
vox = v.*cos(a.*pi/180);
voy = v.*sin(a.*pi/180);
thmax = voy./g;
hmax = voy.^2/(2.*g);
ttot = 2.*thmax;
dmax=vox.*ttot;
tplot=linspace(0,ttot,200);
X = vox.*tplot;
Y = voy.*tplot-0.5.*g.*tplot.^2;
plot(X,Y)
grid

GUIDE MATLAB

You might also like