L'interpolation polynomiale par spline cubiq
wafabard
-
best_of2010 -
best_of2010 -
SALUT TOUT LE MONDE J'AI UN ALGORITHME DE L'INTERPOLATION POLYNOMIALE PAR SPLINE CUBIQUE ET JE VEUX LE TRADUIRE EN MATLAB SI QUELQU'UN PEUT M'AIDER.
VOILA L' ALGORITHME :
pour i=2:n-1
h(i)=x(i+1)-x(i);
t(i,i)=2(h(i)+h(i+1));
t(i,i-1)=h(i-1);
t(i,i+1)=2h(i);
f(i-1)=6((y(i+1)-y(i)) /h(i)-(y(i)-y(i-1))/h(i-1));
t=t(2:n-1,2:n-1);
m=t/f;
m=[0,m,0];
fin
pour i=1:n-1
a(i)=y(i+1)-y(i))/h(i)-(m(i-1)-m(i))*h(i)/6;
b(i)=y(i)-m()*h(i)/6;
fin
pour i=1:n
g(i)(x)=m(i+1)*(x-x(i) )3/h(i)*6+m(i)(x(i+1)-x)3/h(i)*6+a(i)(x-x(i))+b(i);
fin
aidez moi s'il vous plai
VOILA L' ALGORITHME :
pour i=2:n-1
h(i)=x(i+1)-x(i);
t(i,i)=2(h(i)+h(i+1));
t(i,i-1)=h(i-1);
t(i,i+1)=2h(i);
f(i-1)=6((y(i+1)-y(i)) /h(i)-(y(i)-y(i-1))/h(i-1));
t=t(2:n-1,2:n-1);
m=t/f;
m=[0,m,0];
fin
pour i=1:n-1
a(i)=y(i+1)-y(i))/h(i)-(m(i-1)-m(i))*h(i)/6;
b(i)=y(i)-m()*h(i)/6;
fin
pour i=1:n
g(i)(x)=m(i+1)*(x-x(i) )3/h(i)*6+m(i)(x(i+1)-x)3/h(i)*6+a(i)(x-x(i))+b(i);
fin
aidez moi s'il vous plai
A voir également:
- L'interpolation polynomiale par spline cubiq
- Interpolation linéaire excel ✓ - Forum Excel
- Interpolation polynomiale excel ✓ - Forum Matlab
- Interpolation linéaire formule ✓ - Forum Excel
- Régression polynomiale excel - Forum Excel
- Interpolation - Forum Programmation
3 réponses
ba, la traduction en matlab est super simple. Il suffit de remplacer "pour" par "for" et "fin" par "end".
à part la ligne "t=t(2:n-1,2:n-1);" qui devrait te créé des erreurs : à chaque itération ça fait un truc bizarre.
m/f;m=[0,m,0];
ça aussi, c'est étrange, tu divise une matrice par un vecteur, et l'assignation de m est mauvaise, que veux tu faire ?
à part la ligne "t=t(2:n-1,2:n-1);" qui devrait te créé des erreurs : à chaque itération ça fait un truc bizarre.
m/f;m=[0,m,0];
ça aussi, c'est étrange, tu divise une matrice par un vecteur, et l'assignation de m est mauvaise, que veux tu faire ?