CS计算机代考程序代写 f = @(x) x.^3-x;

f = @(x) x.^3-x;
x_l = -0.9;
x_u = 0.9;
eps = 1e-10;
max_iter = 50;
false_position_solver(f,x_l,x_u,eps,max_iter)

function x_r = false_position_solver(f,x_l,x_u,eps,max_iter)

x_r=x_u-f(x_u)*(x_l-x_u)/(f(x_l)-f(x_u));

i = 1;

while abs(f(x_r))>eps && i