MATLAB: Can Matlab generate a function based on XY points

confidence intervalsmatlab trendfitpolyfit

Hello,
I was wondering if this is possible in Matlab.
Say I generate an X and Y array that is not linear. I could connect the points and create a curve but this is labor intensive.
If given a data set can you use Matlab to generate a function that represents these points?
Excel has built in functions to do this and I may try to determine the relationship this way but was wondering if I could do it in Matlab.
Thank you,
Mike

Best Answer

It depends what you want to do. I suggest polyfit and its related functions. You can find the links to all of the other functions at the end of the documentation page for polyfit.
Another option is spline and its friends.