Professional Documents
Culture Documents
if sign(u)==sign(v) disp('Error la funcin debe cambiar de signo en (a,b)'); break; end while ((b-a)*0.5>tol) c=(b+a)/2; w=feval(fun,c); disp(['n=', num2str(n)]); disp(['c=', num2str(c)]); disp(['f(c)=', num2str(w)]); if sign(u)==sign(w) a = c; u=w; else b=c; v=w; end n=n+1; end; x=c