You could use the following:
ft_ = fittype('poly2');
[cf,gf,o] = fit(cdate,pop,ft_)
when I do this my results are:
cf =
Linear model Poly2:
cf(x) = p1*x^2 + p2*x + p3
Coefficients (with 95% confidence bounds):
p1 = 0.006541 (0.006124, 0.006958)
p2 = -23.51 (-25.09, -21.93)
p3 = 2.113e+004 (1.964e+004, 2.262e+004)
gf =
sse: 159.029299176792
rsquare: 0.998712965772009
dfe: 18
adjrsquare: 0.998569961968899
rmse: 2.97236624011533
o =
numobs: 21
numparam: 3
residuals: [21x1 double]
Jacobian: [21x3 double]
exitflag: 1
algorithm: 'QR factorization and solve'
iterations: 1