clear format long % Mulai dengan a=2 dan b=5 a=2; b=5; for i=1:1000 fa=fungsi(a); fb=fungsi(b); c=(a+b)/2; x(i)=c; k(i)=i clc fc=fungsi(c); if (abs(fc))<0.000000001 break end if fa*fc<0 b=c; else a=c; end end plot(k,x), grid on Hasil=[x']