% wpolyfitdemo(p) % Generate some random data for the polynomial p, then fit that % data. If p ends with 0, then the fit will be constrained to % go through the origin. % % To force a variety of weights, poisson statistics are used to % estimate the variance on the individual points, but gaussian % statistics are used to generate new values within that variance.