You are on page 1of 1

Bisección

fx = input('Ingrese la funcion f(x)=' , 's' );


syms x
f = inline(fx);
xi = input('Ingrese el valor inicial inferior: ');
xs = input('Ingrese el valor inicial superiro: ');
tol = input('ingrese el tolerancia: ');
fplot(fx,[xi,xs],'r'),grid,
fxi = f(xi);
fxs = f(xs);
max1 = 1+round((log(xs-xi)-log(tol))/log(2));

if fxi*fxs==0
iffxi==0
fprintf('la raiz de la funcion es %f\n',xi)

You might also like