You are calling it as your objective function to lsqcurvefit. The input arguments are specific in all the curve fitting functions.
You need to call it as:
[p,resnorm] = lsqcurvefit(@(p,t) GlobalChiSq( p, t, Co, Diff, y ), startingVals, x, y lb, ub, options)