MATLAB: How can we display our real roots or points

bisection

>> f = @(x) x^3-3*x-1;
>> fplot(f, [-10 10]); grid on;

Best Answer

Use the roots function:
xr = roots([1 0 -3 -1]);
They all happen to be real. This gives the x-values, so if you want to plot them, the y vector is:
yr = zeros(size(xr));