当前位置: 动力学知识库 > 问答 > 编程问答 >

Matlab polynomial regression exercise

问题描述:

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

分享给朋友:
您可能感兴趣的文章:
随机阅读: