function varargout = CODIGOO(varargin)
% CODIGOO MATLAB code for CODIGOO.fig
% CODIGOO, by itself, creates a new CODIGOO or raises the existing
% singleton*.
%
% H = CODIGOO returns the handle to a new CODIGOO or the handle to
% the existing singleton*.
%
% CODIGOO('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CODIGOO.M with the given input
arguments.
%
% CODIGOO('Property','Value',...) creates a new CODIGOO or raises
the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before CODIGOO_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to CODIGOO_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 CODIGOO
% Last Modified by GUIDE v2.5 26-Jul-2017 21:56:42
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @CODIGOO_OpeningFcn, ...
'gui_OutputFcn', @CODIGOO_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 CODIGOO is made visible.
function CODIGOO_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 CODIGOO (see VARARGIN)
% Choose default command line output for CODIGOO
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes CODIGOO wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = CODIGOO_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 calcular.
function calcular_Callback(hObject, eventdata, handles)
V=get(handles.vi,'String');
A=get(handles.angulo,'String');
V=str2num(V)
A=str2num(A)
A2=((A.*pi)./180);
g=9.81;
t=V./g;
Tv=2.*(V.*(sin(A2))./g);
Hmax=(V.*(sin(A2))./2).*t;
D=(V.*(cos(A2)).*(Tv));
set(handles.hmax,'String', Hmax);
set(handles.tv,'String', Tv);
set(handles.dmax,'String', D);
% hObject handle to calcular (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 limpiar.
function limpiar_Callback(hObject, eventdata, handles)
set(handles.vi,'String', ' ');
set(handles.angulo,'String', ' ');
set(handles.tv,'String', ' ');
set(handles.dmax,'String', ' ');
set(handles.hmax,'String', ' ');
set(handles.axes1,'String', ' ');
% hObject handle to limpiar (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 graficar.
function graficar_Callback(hObject, eventdata, handles)
% hObject handle to graficar (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function tv_Callback(hObject, eventdata, handles)
% hObject handle to tv (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of tv as text
% str2double(get(hObject,'String')) returns contents of tv as a
double
% --- Executes during object creation, after setting all properties.
function tv_CreateFcn(hObject, eventdata, handles)
% hObject handle to tv (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
% Hint: edit 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
function hmax_Callback(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)
% Hints: get(hObject,'String') returns contents of text1 as text
% str2double(get(hObject,'String')) returns contents of text1 as a
double
% --- Executes during object creation, after setting all properties.
function text1_CreateFcn(hObject, eventdata, handles)
% hObject handle to text1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
% Hint: edit 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
function dmax_Callback(hObject, eventdata, handles)
% hObject handle to hfgdcy (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of hfgdcy as text
% str2double(get(hObject,'String')) returns contents of hfgdcy as
a double
% --- Executes during object creation, after setting all properties.
function hfgdcy_CreateFcn(hObject, eventdata, handles)
% hObject handle to hfgdcy (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
% Hint: edit 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
function vi_Callback(hObject, eventdata, handles)
% hObject handle to vi (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of vi as text
% str2double(get(hObject,'String')) returns contents of vi as a
double
% --- Executes during object creation, after setting all properties.
function vi_CreateFcn(hObject, eventdata, handles)
% hObject handle to vi (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
% Hint: edit 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
function angulo_Callback(hObject, eventdata, handles)
% hObject handle to angulo (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of tex5 as text
% str2double(get(hObject,'String')) returns contents of tex5 as a
double
% --- Executes during object creation, after setting all properties.
function tex5_CreateFcn(hObject, eventdata, handles)
% hObject handle to tex5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
% Hint: edit 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 on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
V=get(handles.vi,'String');
A=get(handles.angulo,'String');
V=str2num(V)
A=str2num(A)
A2=((A.*pi)./180);
g=9.81;
t=V./g;
Tvuelo=2.*(V.*(sin(A2))./g);
Hmax=(V.*(sin(A2))./2).*t;
D=(V.*(cos(A2)).*(Tvuelo));
set(handles.hmax,'String', Hmax);
set(handles.tv,'String', Tvuelo);
set(handles.dmax,'String', D);
axes(handles.axes1);
X=linspace(0,Tvuelo,100);
Y=((-10.*(X.^2)./2)+(V.*X));
plot(X,Y),grid;
% hObject handle to pushbutton7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function edit7_Callback(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit7 as text
% str2double(get(hObject,'String')) returns contents of edit7 as a
double
% --- Executes during object creation, after setting all properties.
function edit7_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit7 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
% Hint: edit 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 on button press in pushbutton8.
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)
V=get(handles.vi,'String');
A=get(handles.angulo,'String');
V=str2num(V)
A=str2num(A)
A2=((A.*pi)./180);
g=9.81;
t=V./g;
Tv=2.*(V.*(sin(A2))./g);
Hmax=(V.*(sin(A2))./2).*t;
D=(V.*(cos(A2)).*(Tv));
X = str2double(get(handles.edit7,'String'));
T = X/V*cosd(A2);
Y=((-10.*(T.^2)./2)+(T.*X));
set(handles.text17,'String',Y);
% --- Executes during object creation, after setting all properties.
function text16_CreateFcn(hObject, eventdata, handles)
% hObject handle to text16 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called
% --- Executes during object creation, after setting all properties.
function text17_CreateFcn(hObject, eventdata, handles)
% hObject handle to text17 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns
called