Your objective function is the result of a simulation. You might need to take larger steps in your optimmization routine to avoid the function looking flat at nearby points; see Optimizing a simulation or ODE.
Unfortunately, fminsearch does not allow for tuning options. I suppose that you could artificially scale the problem by taking fun(1e3*x) so that small changes in the position get magnified. Or you could use an Optimization Toolbox solver, using larger-than-default finite difference steps, or a Global Optimization Toolbox solver such as patternsearch.
MATLAB mathematical toolbox documentation