Fonction Scilab
eng - fr


polyfit - fonction polyfit mtlb

Librairie

Séquence d'appel

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

Paramètres

Description

Add here a paragraph of the function description. Other paragraph can be added

Add here a paragraph of the function description

Exemple

Add here scilab instructions and comments

Contenu du fichier


function [p]=polyfit(x, y, n, s)
// return coefficient vector or poly if fourth string argument given
[lhs, rhs] = argn(0)
x = x(:); y = y(:)
m = length(x)
if length(y) <> m, error('x and y must have same length'), end
v = ones(m,n+1)
for i=2:n+1, v(:,i) = x.*v(:,i-1), end
p = (v\y)'
if rhs > 3, p = poly(p, s, 'coeff'), end
endfunction

Fonction(s) utilisée(s)

Add here the used function name and references

Auteurs

enter here the author name Add here the author references