I want to plot the graph of f(x)= x^3 -4x+ 2 on [-2,2] using Matlab. My simple try is:
f = @(x) x^3-4*x+2;
fplot(f,[-2,2]);
The output doesn't show a graph with two axes centred at origin, like the image above, which I would like to see.
How can I modify to have this output (as in the above picture) in a not so complicated way?
Thanks.