Stixbox Function

polyfit - Polynomial curve fitting

Calling Sequence

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

Parameters

Description

polyfit(x,y,n) finds the coefficients of a polynomial p(x) of degree n that fits the data, p(x(i)) ~= y(i), in a least-squares sense. [p,s] = polyfit(x,y,n) returns the polynomial coefficients p and a matrix s for use with polyval to produce error estimates on predictions.