matlab, given a fixpoint solver y = fixpoint(fun, x0), write a wrapper function linsolve_fp(a, b, x0, tol) in matlab
main.m
functiony = fixpoint(fun, x0) maxiter = 1000;
tol = 1e-6;
iter = 0;
x = x0;
whiletrue x_new = fun(x);
if norm(x_new - x, inf) < tol || iter >= maxiter
break;
end x = x_new;
iter = iter + 1;
end y = x_new;
endfunctiony = linsolve_fp(a, b, x0, tol) fun = @(x) a*x + b;
y = fixpoint(fun, x0, tol);
end