Professional Documents
Culture Documents
DE
MOGROVEJO
Nombre:
desarrollo:
ingrese la base del rectangulo:0
ingrese la altura del rectangulo:0
ingrese base menor:2
ingrese base mayor:4
ingrese altura del trapecio:3
ingrese altura del triangulo:0
ingrese base del triangulo:0
m =
0
ans =
9
area del trapecio
SOLUCION:
SOLUCION:
SOLUCION:
function [sol,x,err,iter]=biseccion(fun,a,b,tol,maxiter)
if fa*fb>0;
disp('La funcion debe tener diferente signo en los
extremos del intervalo')
return
end
if fc==0;
a=c;b=c;
elseif fa*fc<0;
b=c; fb=fc;
else fb*fc<0;
a=c; fa=fc;
end
err=b-a;iter=iter+1;
end
sol=c;
if err>tol;
disp('Insuficientes iteraciones')
end