Curve fitting demo in Matlab