Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
304 B
4
Indexable
clc
f=@(x) x*x-3
f=input("Enter the equation:");

a=1;
b=2;
torareble error =0.0001
if f(a)*f(b)<0
  for i= :100
    c= a*f(b)-b*f(a)/f(b)-f(a)

    fprintf("root= %d",c);
    
    if abs (f(c-b))< 0

      break;
    end
    if   f(a)*f(c),0
     b=c;
  end
  b=c;
  end
end
end
Leave a Comment