I guess the answer depends what you want to do with those finite difference approximations. If you want to use it in an algorithm to solve ODEs, your strategy won't work because you don't a priori have a functional form.
This would be a typical matrix math way (assuming your coefficients are correct, i won't check)
cc = [-1,16,-30,16,-1]/12;
funp = @(x) 3*x.^2 + cos(x);
funpp = @(x) 6*x - sin(x);
backward_difference = ((2*fun(x0)-5*fun(x0-dx)+4*fun(x0-2*dx)-fun(x0-3*dx))/dx^2)
central_difference = (-fun(x0+2*dx)+16*fun(x0+dx)-30*fun(x0)+16*fun(x0-dx)-fun(x0-2*dx))/(12*(dx^2))