Question: %define a function (representing f(x)) f = @(x) x.^3 - 9*x.^2 + 23.*x -16; %specify the tolerance xmin = 0; xmax = 2; tol =
%define a function (representing f(x)) f = @(x) x.^3 - 9*x.^2 + 23.*x -16; %specify the tolerance xmin = 0; xmax = 2; tol = 0.01; if(f(xmin) * f(xmax) > 0) f1 = xmin; else xmid = (xmin + xmax)/2; while(abs(xmax - xmin) > tol || abs(f(xmid)) > tol) if(f(xmin)*f(xmid)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
