The problem as posed is easily solved using fmincon, with LINEAR inequality constraints. Use of nonlinear inequality constraints is patently silly, since that forces fmincon to differentiate those constraints.
So if you want to use fmincon, then just supply a linear inequality constraint for each pair of consecutive parameters, in each direction. (Be careful with the direction of the inequalities. I wrote them below, but fmincon assumes one specific direction.)
Having said that, this is also trivial to solve using lsqnonlin or lsqcurvefit. There is no need to formulate the problem for fmincon. if you can use a nonlinear least squares solver to solve a nonlinear least squares problem, then do so. Avoid using fmincon if you can, since fmincon will be less efficient than a least squares tool. Use the tool that is designed to solve the class of problem, IF you can.
Here all that is needed is to solve a nonlinear least squares problem subject to the constraints that
x(i) - x(i+1) <= delta
x(i+1) - x(i) <= delta
Yes, I know that lsqnonlin won't handle linear inequalities. So transform the problem. The trick is to optimize the DIFFERENCE between successive parameter values. In your objective function, just use cumsum. So the first parameter has no upper or lower bound. all other parameters will be bounded by -delta on the lower end, and by delta on the upper end.
function r = objective(X)
x = cumsum(X);
When you call lsqnonlin, you will set the lower and upper bounds as
lb = [-inf,repmat(-delta,1,n-1)];
ub = [inf,repmat(delta,1,n-1)];
So the first element is unbounded, the rest are bounded by delta in EITHER direction. lsqnonlin sees parameters that have only simple bounds, so it is happy. Your objective function will use cumsum internally.
When you get the parameters passed out from lsqnonlin, just use cumsum on them to get the parameters in the form you actually want.
Of course, be careful to pass in starting values to lsqnonlin that will satisfy those bound constraints. But this is easy to do, since you know how the problem is set up.