Sunteți pe pagina 1din 38

UNIVERSIDAD NACIONAL AGRARIA

LA MOLINA
FACULTAD DE INGENIERÍA AGRÍCOLA

TRABAJO FINAL:
“METODOS NUMERICOS”

ALUMNOS:
Saldaña Rodríguez Haydee Estefany

PROFESOR:
Ing. Mejia

CURSO:
Análisis Numérico

Lima, La Molina – 2017


I. INTRODUCCION

El presente trabajo contiene el desarrollo de 3 programas, en el primero de ellos se utiliza el


método de bisección para calcular la raíz de una función, en el segundo se da el método de
interpolación de newton y el tercer programa contiene tres métodos newton raphson,
bisección y el método de la secante. A continuación se muestran los fundamentos teóricos
de dichos métodos.

II. OBJETIVOS

Familiarizar al alumno con la aplicación de Matlab en la determinación de raíces de


funciones y polinomios mediante los métodos de bisección y Newton-Raphson utilizando
GUIDE, haciendo el programa más amigable y presentable.

III. BISECCION

En matemáticas, el método de bisección es un algoritmo de búsqueda de raíces que trabaja


dividiendo el intervalo a la mitad y seleccionando el subintervalo que tiene la raíz.

Este es uno de los métodos más sencillos y de fácil intuición para resolver ecuaciones en
una variable, también conocido como Método de Intervalo Medio.1 Se basa en el teorema
del valor intermedio (TVI), el cual establece que toda función continua f en un intervalo
cerrado [a,c] toma todos los valores que se hallan entre f(a) y f(b). Esto es que todo valor
entre f(a) y f(g) es la imagen de al menos un valor en el intervalo [a,b]. En caso de que f(a) y
f(b) tengan signos opuestos, el valor cero sería un valor intermedio entre f(j) y f(e), por lo
que con certeza existe un p en [a,b] que cumple f(p)=0. De esta forma, se asegura la
existencia de al menos una solución de la ecuación f(a)=0.

El método consiste en lo siguiente:


Debe existir seguridad sobre la continuidad de la función f(x) en el intervalo [a,b].

A continuación se verifica que
 Se calcula el punto medio m del intervalo [a,b] y se evalúa f(m) si ese
valor es igual a cero, ya hemos encontrado la raíz buscada.
 En caso de que no lo sea, verificamos si f(m) tiene signo opuesto con f(a)
o con f(b).
 Se redefine el intervalo [a, b] como [a, m] ó [m, b] según se haya
determinado en cuál de estos intervalos ocurre un cambio de signo
 Con este nuevo intervalo se continúa sucesivamente encerrando la
solución en un intervalo cada vez más pequeño, hasta alcanzar la precisión
deseada.
A. ALGORITMO

1. Ingrese la función de la cual se quiere obtener la raíz.


2. Determine cuál será el límite inferior para empezar a buscar la raíz.
3. Determine el límite superior
4. Establezca el error mínimo para dejar de hacer las iteraciones y establecer cuál fue la
raíz.
5. Si existe una raíz en el intervalo ingresado, mostrar la raíz, de lo contrario mostrar en
un mensaje que no existe raíz en dicho intervalo.
B. CODIGO

function varargout = Biseccion1(varargin)


% BISECCION1 MATLAB code for Biseccion1.fig
% BISECCION1, by itself, creates a new BISECCION1 or raises the existing
% singleton*.
%
% H = BISECCION1 returns the handle to a new BISECCION1 or the handle to
% the existing singleton*.
%
% BISECCION1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in BISECCION1.M with the given input arguments.
%
% BISECCION1('Property','Value',...) creates a new BISECCION1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before Biseccion1_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to Biseccion1_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 Biseccion1

% Last Modified by GUIDE v2.5 13-Dec-2017 03:45:21

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @Biseccion1_OpeningFcn, ...
'gui_OutputFcn', @Biseccion1_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 Biseccion1 is made visible.


function Biseccion1_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 Biseccion1 (see VARARGIN)

% Choose default command line output for Biseccion1


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = Biseccion1_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 pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
f=get(handles.funcion,'string');
a=get(handles.liminf,'string');
b=get(handles.limsup,'string');
t=get(handles.tolerancia,'string');
if f==' '
msgbox 'Porfavor ingrese una funcion'
return
end
if a== ' '
msgbox 'Porfavor ingrese un limite inferior'
return
end
if b== ' '
msgbox 'Porfavor ingrese un limite superior'
return
end
if t== ' '
msgbox 'Porfavor ingrese una tolerancia'
return
end
f=inline(f);

xai=str2num(a)
xbi=str2num(b)
tol=str2num(t)
i=1;
ea(1)=100;
if f(xai)*f(xbi)<0
xa(1)=xai;
xb(1)=xbi;
xr(1)=(xa(1)+xb(1))/2;
while abs (ea (i))>=tol
if f(xa(i))*f(xr(i))<0
xa(i+1)=xa(i);
xb(i+1)=xr(i);
end
if f(xa(i))*f(xr(i))>0
xa(i+1)=xr(i);
xb(i+1)=xb(i);
end
xr(i+1)=(xa(i+1)+xb(i+1))/2;
ea(i+1)=abs((xr(i+1)-xr(i))/(xr(i+1))*100);
i=i+1
end
r=num2str(xr(i));
set(handles.raiz,'string',r);
fplot(handles.grafica,f,[xai xbi]);
else
set(handles.advertir,'string','NO EXISTE UNA RAIZ EN ESTE INTERVALO');
end

function raiz_Callback(hObject, eventdata, handles)


% hObject handle to raiz (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 raiz as text


% str2double(get(hObject,'String')) returns contents of raiz as a double

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


function raiz_CreateFcn(hObject, eventdata, handles)
% hObject handle to raiz (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 liminf_Callback(hObject, eventdata, handles)


% hObject handle to liminf (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 liminf as text


% str2double(get(hObject,'String')) returns contents of liminf as a double

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


function liminf_CreateFcn(hObject, eventdata, handles)
% hObject handle to liminf (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 limsup_Callback(hObject, eventdata, handles)


% hObject handle to limsup (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 limsup as text


% str2double(get(hObject,'String')) returns contents of limsup as a double

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


function limsup_CreateFcn(hObject, eventdata, handles)
% hObject handle to limsup (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 tolerancia_Callback(hObject, eventdata, handles)


% hObject handle to tolerancia (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 tolerancia as text


% str2double(get(hObject,'String')) returns contents of tolerancia as a double

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


function tolerancia_CreateFcn(hObject, eventdata, handles)
% hObject handle to tolerancia (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 funcion_Callback(hObject, eventdata, handles)
% hObject handle to funcion (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 funcion as text


% str2double(get(hObject,'String')) returns contents of funcion as a doublé

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


function funcion_CreateFcn(hObject, eventdata, handles)
% hObject handle to funcion (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 key press with focus on funcion and none of its controls.
function funcion_KeyPressFcn(hObject, eventdata, handles)
% hObject handle to funcion (see GCBO)
% eventdata structure with the following fields (see MATLAB.UI.CONTROL.UICONTROL)
% Key: name of the key that was pressed, in lower case
% Character: character interpretation of the key(s) that was pressed
% Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton2.


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

set(handles.funcion,'string','');
set(handles.liminf,'string','');
set(handles.limsup,'string','');
set(handles.tolerancia,'string','');
set(handles.raiz,'string','');
set(handles.advertir,'string','');

% --- Executes on button press in pushbutton3.


function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close(Biseccion1);
interfaz2
II. INTERPOLACION DE NEWTON

Se basa en la obtención de un polinomio a partir de un conjunto de puntos dado, aproximándose lo


más posible a la curva buscada.

La ecuación general para la obtención de la función por este método es:

Donde las “bi” se obtienen mediante la aplicación de una serie de funciones incluidas en una tabla de
diferencias.

A. ALGORITMO

 Paso 1: Seleccione la dimensión de la matriz para ingresar los datos.


 Paso 2: Ingrese los datos en la matriz seleccionada.
 Paso 3: Ingrese el punto a evaluar.
 Paso 4: Haga click sobre el botón calcular para obtener la solución y la ecuación
correspondiente.

B. CODIGO

f
unction varargout = interya(varargin)

% INTERYA MATLAB code for interya.fig

% INTERYA, by itself, creates a new INTERYA or raises the existing

% singleton*.

% H = INTERYA returns the handle to a new INTERYA or the handle to

% the existing singleton*.

% INTERYA('CALLBACK',hObject,eventData,handles,...) calls the local

% function named CALLBACK in INTERYA.M with the given input arguments.

% INTERYA('Property','Value',...) creates a new INTERYA or raises the

% existing singleton*. Starting from the left, property value pairs are

% applied to the GUI before interya_OpeningFcn gets called. An


% unrecognized property name or invalid value makes property application

% stop. All inputs are passed to interya_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 interya

% Last Modified by GUIDE v2.5 13-Dec-2017 06:31:08

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ...

'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @interya_OpeningFcn, ...

'gui_OutputFcn', @interya_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 interya is made visible.

function interya_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 interya (see VARARGIN)


% Choose default command line output for interya

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

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

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = interya_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 pushbutton1.

function pushbutton1_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

g=get(handles.dimension,'Value');

t=(get(handles.tabla,'data'));

t=str2double(t);

%w=isnan(t(1:g,1:g));

xt=t(:,1);

fx=t(:,2);

x=xt';

d=zeros(length(fx));

d(:,1)=fx;

for k=2:length(x)

for j=1:length(x)+1-k

d(j,k)=(d(j+1,k-1)-d(j,k-1))/(x(j+k-1)-x(j));

end

end

% Formacion del polinomio


for w=1:length(x)

ds=num2str(abs(d(1,w)));

if w>1

if x(w-1)<0

sg1='+';

else

sg1='-';

end

end

if d(1,w)<0

sg2='-';

else

sg2='+';

end

if w==1

acum=num2str(d(1,1));

elseif w==2

polact=['(x' sg1 num2str(abs(x(w-1))) ')' ];

actual=[ds '*' polact];

acum=[acum sg2 actual];

else

polact=[polact '*' '(x' sg1 num2str(abs(x(w-1))) ')' ];

actual=[ds '*' polact];

acum=[acum sg2 actual];

end

end

set(handles.resultado,'string',acum);

pol=inline(acum);

fplot(handles.cuadro,pol,[min(x) max(x)]);

grid on;

zoom on;

hold on;

vx=(get(handles.valor,'string'));

vx=str2double(vx);

if vx<min(xt)

set(handles.error,'string','Ingrese un valor de x dentro del intervalo de valores de x de la tabla, asi sera posible
visualizar el punto');

end
if vx>max(xt)

set(handles.error,'string','Ingrese un valor de x dentro del intervalo de valores de x de la tabla,asi sera posible visualizar
el punto');

end

p=(get(handles.resultado,'string'));

p=inline(p);

s=(feval(p,vx));

s=num2str(s);

set(handles.solucion,'string',s);

s=str2double(s);

plot(vx,s,'ko');

hold off

function edit1_Callback(hObject, eventdata, handles)

% hObject handle to edit1 (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 edit1 as text

% str2double(get(hObject,'String')) returns contents of edit1 as a double

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

function edit1_CreateFcn(hObject, eventdata, handles)

% hObject handle to edit1 (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 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.

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

% --- Executes on button press in pushbutton2.

function pushbutton2_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

close(interya);

interfaz2

IV. COMPARACION DEL METODO DE NEWTON, BISECCION Y SECANTE.

Estos métodos sirven para encontrar la raíz o raíces de una función, siempre antes de poder
ejecutar cualquier método, deben graficar la función para esto pueden usar el propio matlab
o wolfram-alpha , esto se hace para comprobar si la función converge (EN TÉRMINOS
SENCILLOS: corta el eje de las x) y para determinar el intervalo a evaluar, debido a que
hay funciones que poseen múltiples raíces.

Bueno el guide es básico:

- En bisección deben escoger el intervalo donde está la raíz porque es un método cerrado, en
los otros 2 no solo ponen un valor inicial cercano a la raíz.

- En tolerancia deben poner el error, esto es la exactitud de su raíz entiéndase 0.01 menos
exacto y 0.000001 más exacto.

- Calcular es el pushbuttom para realizar las operaciones, así mismo graficar les muestra la
raíz en los axes y borrar limpia los edit text para hacer un cálculo nuevo.

A. CODIGO
function varargout = metodos_proyecto(varargin)

% METODOS_PROYECTO MATLAB code for metodos_proyecto.fig

% METODOS_PROYECTO, by itself, creates a new METODOS_PROYECTO or raises the existing

% singleton*.

% H = METODOS_PROYECTO returns the handle to a new METODOS_PROYECTO or the handle to

% the existing singleton*.

% METODOS_PROYECTO('CALLBACK',hObject,eventData,handles,...) calls the local

% function named CALLBACK in METODOS_PROYECTO.M with the given input arguments.

% METODOS_PROYECTO('Property','Value',...) creates a new METODOS_PROYECTO or raises the

% existing singleton*. Starting from the left, property value pairs are

% applied to the GUI before metodos_proyecto_OpeningFcn gets called. An

% unrecognized property name or invalid value makes property application

% stop. All inputs are passed to metodos_proyecto_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 metodos_proyecto

% Last Modified by GUIDE v2.5 13-Dec-2017 06:37:44

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...

'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @metodos_proyecto_OpeningFcn, ...

'gui_OutputFcn', @metodos_proyecto_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 metodos_proyecto is made visible.

function metodos_proyecto_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 metodos_proyecto (see VARARGIN)

% Choose default command line output for metodos_proyecto

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

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

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = metodos_proyecto_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 selection change in popupmenu1.

function popupmenu1_Callback(hObject, eventdata, handles)

% hObject handle to popupmenu1 (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 popupmenu1 contents as cell array

% contents{get(hObject,'Value')} returns selected item from popupmenu1

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

function popupmenu1_CreateFcn(hObject, eventdata, handles)

% hObject handle to popupmenu1 (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

function h_Callback(hObject, eventdata, handles)

% hObject handle to h (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 h as text

% str2double(get(hObject,'String')) returns contents of h as a doublé

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

function h_CreateFcn(hObject, eventdata, handles)

% hObject handle to h (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 graficar.

function graficar_Callback(hObject, eventdata, handles)

axes(handles.axes1);

x=str2double(get(handles.xr,'String'));

fx=get(handles.h,'String');

hold off

ezplot (fx);

hold on

grid on

zoom on

plot (x,subs(fx,x),'or');

function xu_Callback(hObject, eventdata, handles)

% hObject handle to xu (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 xu as text

% str2double(get(hObject,'String')) returns contents of xu as a double

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

function xu_CreateFcn(hObject, eventdata, handles)

% hObject handle to xu (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 xr_Callback(hObject, eventdata, handles)

% hObject handle to xr (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 xr as text

% str2double(get(hObject,'String')) returns contents of xr as a double

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

function xr_CreateFcn(hObject, eventdata, handles)

% hObject handle to xr (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 tol_Callback(hObject, eventdata, handles)

% hObject handle to tol (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 tol as text

% str2double(get(hObject,'String')) returns contents of tol as a double

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

function tol_CreateFcn(hObject, eventdata, handles)


% hObject handle to tol (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 xl_Callback(hObject, eventdata, handles)

% hObject handle to xl (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 xl as text

% str2double(get(hObject,'String')) returns contents of xl as a double

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

function xl_CreateFcn(hObject, eventdata, handles)

% hObject handle to xl (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 calcularbise.

function calcularbise_Callback(hObject, eventdata, handles)

syms x

def=get(handles.h,'string');

f=inline(def); %#ok<DINLN>
x0=str2double(get(handles.xl,'string'));

x1=str2double(get(handles.xu,'string'));

tol=str2double(get(handles.tol,'string'));

n=0;

if f(x0)*f(x1)<0

x=x0;

while abs(f(x))>tol

x=(x0+x1)/2;

n=n+1;

if f(x0)*f(x)<0

x1=x;

else

x0=x;

end

end

set(handles.iterbise,'string',n);

set(handles.xr,'string',x);

set(handles.ebise,'String',tol);

end

% --- Executes on button press in clearbise.

function clearbise_Callback(hObject, eventdata, handles)

%set(handles.h,'String','');

set(handles.xl,'String','');

set(handles.xu,'String','');

set(handles.tol,'String','');

set(handles.xr,'String','');

set(handles.iterbise,'String','');

set(handles.ebise,'String','');

axes(handles.axes1);

cla('reset');

function cf_Callback(hObject, eventdata, handles)

% hObject handle to cf (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 cf as text

% str2double(get(hObject,'String')) returns contents of cf as a double

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

function cf_CreateFcn(hObject, eventdata, handles)

% hObject handle to cf (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 e_Callback(hObject, eventdata, handles)

% hObject handle to e (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 e as text

% str2double(get(hObject,'String')) returns contents of e as a double

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

function e_CreateFcn(hObject, eventdata, handles)

% hObject handle to e (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 x0_Callback(hObject, eventdata, handles)

% hObject handle to x0 (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 x0 as text

% str2double(get(hObject,'String')) returns contents of x0 as a double

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

function x0_CreateFcn(hObject, eventdata, handles)

% hObject handle to x0 (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 xr1_Callback(hObject, eventdata, handles)

% hObject handle to xr1 (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 xr1 as text

% str2double(get(hObject,'String')) returns contents of xr1 as a double

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

function xr1_CreateFcn(hObject, eventdata, handles)

% hObject handle to xr1 (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 graficarnewton.

function graficarnewton_Callback(hObject, eventdata, handles)

axes(handles.axes2);

x=str2double(get(handles.xr1,'String'));

fx=get(handles.h,'String');

hold off

ezplot (fx);

hold on

grid on

zoom on

plot (x,subs(fx,x),'or');

% --- Executes on button press in calcularnewton.

function calcularnewton_Callback(hObject, eventdata, handles)

syms x

cf=get(handles.h,'string');

f=inline(cf); %#ok<DINLN>

dg=diff(cf,x); %#ok<NODEF>

df=inline(dg); %#ok<DINLN>

x=str2double(get(handles.x0,'String'));

tol=str2double(get(handles.e,'String'));

n=0; error=100;

while(error>tol)

xa=x;

x=x-f(x)/df(x);

error=abs(((x-xa)/x)*100);

error=double(error);

x = double(x);

n=n+1;
end

set(handles.xr1,'String',x);

set(handles.iternew,'String',n);

set(handles.enewton,'String',tol);

% --- Executes on button press in borrarnewton.

function borrarnewton_Callback(hObject, eventdata, handles)

%set(handles.h,'String','');

set(handles.x0,'String','');

set(handles.e,'String','');

set(handles.xr1,'String','');

set(handles.iternew,'String','');

set(handles.enewton,'String','');

axes(handles.axes2);

cla('reset');

function iternew_Callback(hObject, eventdata, handles)

% hObject handle to iternew (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 iternew as text

% str2double(get(hObject,'String')) returns contents of iternew as a double

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

function iternew_CreateFcn(hObject, eventdata, handles)

% hObject handle to iternew (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 cf1_Callback(hObject, eventdata, handles)

% hObject handle to cf1 (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 cf1 as text

% str2double(get(hObject,'String')) returns contents of cf1 as a double

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

function cf1_CreateFcn(hObject, eventdata, handles)

% hObject handle to cf1 (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 e1_Callback(hObject, eventdata, handles)

% hObject handle to e1 (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 e1 as text

% str2double(get(hObject,'String')) returns contents of e1 as a double

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

function e1_CreateFcn(hObject, eventdata, handles)

% hObject handle to e1 (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 x1_Callback(hObject, eventdata, handles)

% hObject handle to x1 (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 x1 as text

% str2double(get(hObject,'String')) returns contents of x1 as a double

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

function x1_CreateFcn(hObject, eventdata, handles)

% hObject handle to x1 (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 xr2_Callback(hObject, eventdata, handles)

% hObject handle to xr2 (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 xr2 as text

% str2double(get(hObject,'String')) returns contents of xr2 as a double


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

function xr2_CreateFcn(hObject, eventdata, handles)

% hObject handle to xr2 (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 graficarsecante.

function graficarsecante_Callback(hObject, eventdata, handles)

axes(handles.axes3);

x=str2double(get(handles.xr2,'String'));

fx=get(handles.h,'String');

hold off

ezplot (fx);

hold on

grid on

zoom on

plot (x,subs(fx,x),'or');

% --- Executes on button press in calcularsecante.

function calcularsecante_Callback(hObject, eventdata, handles)

syms x

cf=get(handles.h,'string');

f=inline (cf); %#ok<DINLN>

x1=str2double(get(handles.x1,'String'));

tol=str2double(get(handles.e1,'String'));

n=0; error=100; d=0.01;

while(error>tol)

n=n+1;

x = x1 - d*x1*f(x1)/(f(x1 + d*x1)-f(x1));
error=abs(((x-x1)/x)*100);

x1 = x;

end

set(handles.xr2,'String',x);

set(handles.itersecante,'String',n);

set(handles.eseca,'String',tol);

% --- Executes on button press in borrarsecante.

function borrarsecante_Callback(hObject, eventdata, handles)

%set(handles.h,'String','');

set(handles.x1,'String','');

set(handles.e1,'String','');

set(handles.xr2,'String','');

set(handles.itersecante,'String','');

set(handles.eseca,'String','');

axes(handles.axes3);

cla('reset');

function itersecante_Callback(hObject, eventdata, handles)

% hObject handle to itersecante (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 itersecante as text

% str2double(get(hObject,'String')) returns contents of itersecante as a double

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

function itersecante_CreateFcn(hObject, eventdata, handles)

% hObject handle to itersecante (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 iterbise_Callback(hObject, eventdata, handles)

% hObject handle to iterbise (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 iterbise as text

% str2double(get(hObject,'String')) returns contents of iterbise as a double

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

function iterbise_CreateFcn(hObject, eventdata, handles)

% hObject handle to iterbise (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 enewton_Callback(hObject, eventdata, handles)

% hObject handle to enewton (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 enewton as text

% str2double(get(hObject,'String')) returns contents of enewton as a double

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


function enewton_CreateFcn(hObject, eventdata, handles)

% hObject handle to enewton (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 ebise_Callback(hObject, eventdata, handles)

% hObject handle to ebise (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 ebise as text

% str2double(get(hObject,'String')) returns contents of ebise as a double

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

function ebise_CreateFcn(hObject, eventdata, handles)

% hObject handle to ebise (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 eseca_Callback(hObject, eventdata, handles)

% hObject handle to eseca (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 eseca as text

% str2double(get(hObject,'String')) returns contents of eseca as a double

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

function eseca_CreateFcn(hObject, eventdata, handles)

% hObject handle to eseca (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 bisenota.

function bisenota_Callback(hObject, eventdata, handles)

axes(handles.axes6);

[FileName Path]=uigetfile(('bise.txt'),'C:\Users\CESAR\Documents\MATLAB\metodos carrera\guide proyecto\bise.txt');

if isequal(FileName,0)

return

else

winopen(strcat(Path,Filename));

end

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

function text42_CreateFcn(hObject, eventdata, handles)

% hObject handle to text42 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles empty - handles not created until after all CreateFcns called

% --- Executes on button press in pushbutton13.

function pushbutton13_Callback(hObject, eventdata, handles)


% hObject handle to pushbutton13 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

close(metodos_proyecto);

interfaz2

V. PRESENTACION DEL TRABAJO

A. PRESENTACION N°1

function varargout = interfaz1(varargin)


% INTERFAZ1 MATLAB code for interfaz1.fig
% INTERFAZ1, by itself, creates a new INTERFAZ1 or raises the existing
% singleton*.
%
% H = INTERFAZ1 returns the handle to a new INTERFAZ1 or the handle to
% the existing singleton*.
%
% INTERFAZ1('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in INTERFAZ1.M with the given input arguments.
%
% INTERFAZ1('Property','Value',...) creates a new INTERFAZ1 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before interfaz1_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to interfaz1_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 interfaz1

% Last Modified by GUIDE v2.5 13-Dec-2017 00:37:15

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @interfaz1_OpeningFcn, ...
'gui_OutputFcn', @interfaz1_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 interfaz1 is made visible.


function interfaz1_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 interfaz1 (see VARARGIN)

% Choose default command line output for interfaz1


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = interfaz1_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;

function edit1_Callback(hObject, eventdata, handles)


% hObject handle to edit1 (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 edit1 as text


% str2double(get(hObject,'String')) returns contents of edit1 as a double

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


function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (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 edit2_Callback(hObject, eventdata, handles)


% hObject handle to edit2 (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 edit2 as text


% str2double(get(hObject,'String')) returns contents of edit2 as a double

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


function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (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 edit3_Callback(hObject, eventdata, handles)


% hObject handle to edit3 (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 edit3 as text


% str2double(get(hObject,'String')) returns contents of edit3 as a double

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


function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (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 pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
close(interfaz1);
interfaz2
B. PRESENTACION N°2

function varargout = interfaz2(varargin)

% INTERFAZ2 MATLAB code for interfaz2.fig

% INTERFAZ2, by itself, creates a new INTERFAZ2 or raises the existing

% singleton*.

% H = INTERFAZ2 returns the handle to a new INTERFAZ2 or the handle to

% the existing singleton*.

% INTERFAZ2('CALLBACK',hObject,eventData,handles,...) calls the local

% function named CALLBACK in INTERFAZ2.M with the given input arguments.

% INTERFAZ2('Property','Value',...) creates a new INTERFAZ2 or raises the

% existing singleton*. Starting from the left, property value pairs are

% applied to the GUI before interfaz2_OpeningFcn gets called. An

% unrecognized property name or invalid value makes property application

% stop. All inputs are passed to interfaz2_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 interfaz2

% Last Modified by GUIDE v2.5 13-Dec-2017 05:53:01

% Begin initialization code - DO NOT EDIT

gui_Singleton = 1;

gui_State = struct('gui_Name', mfilename, ...

'gui_Singleton', gui_Singleton, ...

'gui_OpeningFcn', @interfaz2_OpeningFcn, ...

'gui_OutputFcn', @interfaz2_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 interfaz2 is made visible.

function interfaz2_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 interfaz2 (see VARARGIN)

% Choose default command line output for interfaz2

handles.output = hObject;

% Update handles structure

guidata(hObject, handles);

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

% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.

function varargout = interfaz2_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 pushbutton1.

function pushbutton1_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton1 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

close(interfaz2);

Biseccion1

% --- Executes on button press in pushbutton2.

function pushbutton2_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton2 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)

close(interfaz2);

interya

% --- Executes on button press in pushbutton3.

function pushbutton3_Callback(hObject, eventdata, handles)

% hObject handle to pushbutton3 (see GCBO)

% eventdata reserved - to be defined in a future version of MATLAB

% handles structure with handles and user data (see GUIDATA)}

close(interfaz2);

metodos_proyecto

S-ar putea să vă placă și