Am 08.12.2018 um 01:06 schrieb LucaLuca:

> hi,

> i try this example :

>

> function esercizio_interpolazione()

>

> pkg load statistics

>

> a=[4 5 6 -1 0 4 -2 0 -3]

>

> b=[1 2 3 4 5 6 7 8 9]

>

> yi =polyfit(a',b',1)

Luca,

you should read the documentation with some attention

-- P = polyfit (X, Y, N)

-- [P, S] = polyfit (X, Y, N)

-- [P, S, MU] = polyfit (X, Y, N)

Return the coefficients of a polynomial P(X) of degree N that

minimizes the least-squares-error of the fit to the points '[X,

Y]'.

You are inverting X and Y

yi =polyfit(b',a',1)

yi =

-0.90000 5.94444

---

Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.

https://www.avast.com/antivirus