问题描述:

A friend asked me to help him with an exercise in matlab, but I have 0 knowledge of matlab programming.

His question is:

**Numerical approximation of functions by least squares: linear regression + parabolic regression + polynomial regression with any degree polynomial**

I hope the translation makes sense.

He has to write a matlab code to answer to that question. Having no knowledge of matlab, can anyone show me how this is done and maybe some explanation alongside the code?

Thank you

I would start with the built-in Curve Fitting tool in the Apps tab of the GUI. Here's a description from Matlab: http://www.mathworks.com/help/curvefit/interactive-curve-and-surface-fitting-.html

Basically, it involves loading up the data you want to fit (e.g. as row vectors x and y) and assigning them to the curve fitting tool.

There are of course a wealth of non-GUI regression models. For example, linear regression: http://www.mathworks.com/help/matlab/data_analysis/linear-regression.html