Professional Documents
Culture Documents
Practica 7 - JPRM
Practica 7 - JPRM
Practica 7 - JPRM
FACULTAD DE TECNOLOGIA
CARRERA INGENIERIA CIVIL
PRACTICA 9
INTERFAZ GRAFICA
Desarrollar una GUI que grafique la función coseno, pero en la que se pueda seleccionar el
número de los términos en la serie que aproxima la función coseno.
INTERFAZ
function varargout = PRACT1(varargin)
% PRACT1 MATLAB code for PRACT1.fig
% PRACT1, by itself, creates a new PRACT1 or raises the existing
% singleton*.
%
% H = PRACT1 returns the handle to a new PRACT1 or the handle to
% the existing singleton*.
%
% PRACT1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PRACT1.M with the given input
arguments.
%
% PRACT1('Property','Value',...) creates a new PRACT1 or raises the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before PRACT1_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to PRACT1_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
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = PRACT1_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)
for i=1:nn
fc=(-1)^i*x^(2*i)/factorial(2*i);
end
fplot(handles.axes1,fc,[-150;150]);
2. Diseñe una interfaz grafica en la que se lea alguna de las funciones trigonométricas y
se grafique en un rango dado por el usuario. Se debe leer la función como:
sen ( 2∗pi∗x ) ,cos ( 2∗pi∗x ) , tan ( 2∗pi∗x ) , sec ( 2∗pi∗x ) , csc ( 2∗pi∗x ) , cot ( 2∗pi∗x ) .
INTERFAZ
function varargout = PRACT2(varargin)
% PRACT2 MATLAB code for PRACT2.fig
% PRACT2, by itself, creates a new PRACT2 or raises the existing
% singleton*.
%
% H = PRACT2 returns the handle to a new PRACT2 or the handle to
% the existing singleton*.
%
% PRACT2('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PRACT2.M with the given input
arguments.
%
% PRACT2('Property','Value',...) creates a new PRACT2 or raises the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before PRACT2_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to PRACT2_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
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = PRACT2_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)
SOLUCION
3. Diseñe una interfaz en la cual se ingrese una función y una constante. Mediante la
misma calcule la derivada simplifique la expresión, calcule la integral indefinida, evalué
en la constante ingresada y grafique la función.
INTERFAZ
function varargout = PRACT3(varargin)
% PRACT3 MATLAB code for PRACT3.fig
% PRACT3, by itself, creates a new PRACT3 or raises the existing
% singleton*.
%
% H = PRACT3 returns the handle to a new PRACT3 or the handle to
% the existing singleton*.
%
% PRACT3('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PRACT3.M with the given input
arguments.
%
% PRACT3('Property','Value',...) creates a new PRACT3 or raises the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before PRACT3_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to PRACT3_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
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = PRACT3_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)
simp=char(simplify(f));
set(handles.sim,'string',simp);
integral=char(int(f));
set(handles.int,'string',integral);
SOLUCION
4. Diseñe una interfaz en la cual ingrese una temperatura en una de las escalas: Celsius,
kelvin, Fahrenheit; y pueda convertir a las otras dos escalas restantes. La GUI puede
ser similar a:
INTERFAZ
function varargout = PRACT4(varargin)
% PRACT4 MATLAB code for PRACT4.fig
% PRACT4, by itself, creates a new PRACT4 or raises the existing
% singleton*.
%
% H = PRACT4 returns the handle to a new PRACT4 or the handle to
% the existing singleton*.
%
% PRACT4('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in PRACT4.M with the given input
arguments.
%
% PRACT4('Property','Value',...) creates a new PRACT4 or raises the
% existing singleton*. Starting from the left, property value pairs
are
% applied to the GUI before PRACT4_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property
application
% stop. All inputs are passed to PRACT4_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
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = PRACT4_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)