Professional Documents
Culture Documents
Ejercicio:
CODIGO:
clear all
format short;
f=inline(fun);
for k=1:cont
c=b-((f(b)*(b-a))/ f(b)-f(a));
e=abs((b-a)/2);
if f(a)*f(c)<0
b=c;
else
a=c;
end
end
fprintf('\n \tk \ta \tb \tc \tf(a) \tf(b) \tf(c) \terror \n')
disp(A)
fprintf('Solución:\n c=%8.5f\n',c)
fprintf('f(c)=%8.5f\n',f(c))
fprintf('error=%8.5f\n',e)