MATLAB: Simple x-y curve fitting from data set.

curve fittingdatasetMATLAB

I'm struggling to find a simple example of simple curve fitting in MATLAB.
I just want to do a best-fit curve for the following data:
x = [1 1.5 2 2.5 3 10e10]
y = [19.74 14.26 12.34 11.45 10.97 9.87];
Please could someone show me how to do it?

Best Answer

If you type
doc polyfit
in the MATLAB command window, you will see a simple example (and of course the syntax of the command).
EDIT:
I didn't really pay attention to the, uh, unusual shape of your data. polyfit() does simple polynomial fitting, so it's not right for you.
There's not really going to be a fit for a point "at infinity". You should probably add some detail about what you are trying to really accomplish here.
Related Question