%main.m
bisect = bisection("func", 0, 2, 0.01);
newt = newton("func", "diff_func", 0, 0.01);
sec = secant("func", 0, 2, 0.01);
fprintf("이분법 : %f \n", bisect);
fprintf("newton : %f \n", newt);
fprintf("secant : %f \n", sec);
%func.m
function f = func(x)
f = 2*x^3-3*x-4;
end
%diff_func.m
function f = diff_func(x)
f = 6*x^2-3;
end