Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function w = interpolacja_lagrangea( x, y )
- %INTERPOLACJA_LAGRANGEA
- %
- if(length(x) ~= length(y))
- disp('liczba wspó³rzêdnych x-owych nie jest równa liczbie wspó³rzêdnych y-kowych');
- else
- N = length(x);
- w = 0;
- for i = 1:N
- P = 1;
- for j = 1:N
- if j~=i
- P = conv(P,[1 -x(j)])/(x(i) - x(j));
- end
- end
- w = w + y(i) * P;
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement