Well, it's not random, but you can use the Least Squares method to fit a set of data points with a curve (a.k.a Curve Fitting).
There is a built in matlab function that does it.

Regards,
Zachm