hw_02_4_14
raw download clone
TEXT
views 8
,
size 208 b
clear;
clc;
format long;
f = @(x) (x^2) - 3;
a = 1;
b = 2;
Err = 1;
while Err > 10^(-4)
  c = a + ((b - a) / 2);
  if f(c) * f(a) < 0
    b = c;
  else
    a = c;
  end
  Err = abs(f(c));
end
close fullscreen
Login or Register to edit or fork this paste. It's free.