'Gui - Name' 'Gui - Singleton' 'Gui - Openingfcn' 'Gui - Outputfcn' 'Gui - Layoutfcn' 'Gui - Callback'

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

function varargout = pppp5(varargin)

gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @pppp5_OpeningFcn, ...
'gui_OutputFcn', @pppp5_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

function pppp5_OpeningFcn(hObject, eventdata, handles, varargin)

handles.output = hObject;

guidata(hObject, handles);

function varargout = pppp5_OutputFcn(hObject, eventdata, handles)

varargout{1} = handles.output;

function funcion_Callback(hObject, eventdata, handles)

function funcion_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function pi_Callback(hObject, eventdata, handles)

function pi_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function error_Callback(hObject, eventdata, handles)

function error_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function despeje_Callback(hObject, eventdata, handles)

function despeje_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function edit5_Callback(hObject, eventdata, handles)

function edit5_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in boton.


function boton_Callback(hObject, eventdata, handles)
f=inline (get (handles.despeje, 'string'));
x=str2double(get(handles.pi,'string'));
e=str2double(get (handles.error, 'string'));
It=10;
Fx=f(x)
error=e+1;
Cont=0;

Z=[Cont,x,Fx,e];

while Fx~=0 && error>e && Cont<It


xn=Fx(x);
xn=f(xn);
error=abs((xn-x)/xn);
Cont=Cont+1;
Z(Cont,1)=Cont;
Z(Cont,2)=xn;
Z(Cont,3)=Fx;
Z(Cont,4)=Error;
x=xn;

end
if Fx==0
set(handles.resultado,'string', v);

else
if error<e
set(handles.resultado,'string', v);
end
end

You might also like