MATLAB: How to perform a linear least squares fit

MATLAB

Hello.
I would like to perform a linear least squares fit to 3 data points.
The help files are very confusing, to the point where i can't figure out whether this is a base function of Matlab, I need the curve fitting toolbox, optimization toolbox, or both.
Thanks,
Alex

Best Answer

You don’t need any toolboxes. Use polyfit (link) and polyval functions, or the mldivide (link) operator.
Related Question