salut les gars , J'ai travaillé sur le Newton interpolation. La fonction est:
Ma question est : Comment puis-je entrer les valeurs x, y, xi de mon image Matrice ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part yi = NtnInter (x, y, xi)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 % Fonction newton code interpolation function y = newtonInterpolation(X,Y,x) % interpolate values y at points x using data vectors X and Y n = length(X); % build coefficient table D = diag(Y); for m = 1:n for i = 1:n-m j = i+m; D(i,j) = (D(i+1,j)-D(i,j-1))/(X(j)-X(i)); end end % return final value y = Y(1)*ones(size(x)); for k = 2:n s = D(1,k); for i = 1:k-1 s = s.*(x-X(i)*ones(size(x))); end y = y+s; end end
Partager