`clcclear allclose all% f(x) = x^3 - x -3;`

% devf(x) = diff(x^3 - x - 3);

Ea = 100;m = 0;k = 0;1i;x0=(-2-2*i);display(' k realx imagx abs(f(xk)) '); while abs(x0^3 - x0 - 3)>10^-5 if m < 50 x1 = x0 - ((x0^3 - x0 - 3) ./ ((3 * x0)^2 - 1)); Ea = abs(((x1 - x0) / x1) * 100); realx=real(x0); imagx=imag(x0); fprintf('%2.0f %12.5f %12.5f %12.5f %12.5f\n', k , realx, imagx, abs(x0^3 - x0 - 3)) k = k + 1; x0 = x1; else break end m = m + 1;end

# MATLAB: How can we write our values in a column

column

###### Related Question

- Hi guys,i am beginner at matlab.Can you help me with that?I have a problem which is not plotting the values.
- How to tabulate this results using fprintf
- I cannot plot the Bisection Method Code
- How to optimize this problem to find the most suitable set of variables to maximize the cost function
- How to plot a fitness or objective function with optimum values
- Can I use a compiled (.exe) file to generate the objective functions while running optimisation in MATLAB

## Best Answer