Matlab curve fitting least squares method

Source: Internet
Author: User

Curve Fitting

A data set on a known discrete point, known as a function value on a point set, constructs an analytic function (a graph of a curve) so as to be as close to a given value as possible at the original discrete point, a process known as curve fitting. The most commonly used curve fitting method is the least squares method, which is to find the function to make the smallest.

matlab function:p=polyfit (x,y,n)

[p,s]= polyfit (X,y,n)

Description:x, y is a data point, n is a polynomial order, and p is a polynomial coefficient vector p with power from high to low. The x must be monotonous. The matrix S is used to generate an error estimate for the predicted value. (see next function Polyval)

Polynomial-curve evaluation function: Polyval ()

Call Format: Y=polyval (p,x)

[Y,delta]=polyval (p,x,s)

Description:y=polyval (p,x) Returns the value of the polynomial corresponding to the argument x at the given coefficient p.

[Y,delta]=polyval (P,x,s) uses the Polyfit function's option output s to derive the error estimate y DELTA. It assumes that the error of the Polyfit function data input is independent and normal, and the variance is constant. The Y delta will contain at least 50% of the predicted values.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.