SHARE
TWEET

interpolacja

a guest May 20th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function w = interpolacja_lagrangea( x, y )
  2. %INTERPOLACJA_LAGRANGEA  
  3. %
  4.     if(length(x) ~= length(y))
  5.         disp('liczba wspó³rzêdnych x-owych nie jest równa liczbie wspó³rzêdnych y-kowych');
  6.     else
  7.         N = length(x);
  8.         w = 0;
  9.         for i = 1:N
  10.             P = 1;
  11.             for j = 1:N
  12.                 if j~=i
  13.                     P = conv(P,[1 -x(j)])/(x(i) - x(j));
  14.                 end
  15.             end
  16.             w = w + y(i) * P;
  17.         end
  18.     end
  19. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top