Advertisement
encoree1996

Untitled

May 4th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. function [ vec ] = minterp1( x,y,x1 )
  2.  
  3. l = length(x);
  4. L = zeros(length(x1),1);
  5. for n=1:length(x1)
  6. sum = 0;
  7. for i=1:l
  8. il=1;
  9.  
  10. for j=1:l
  11. if j ~= i
  12. il=il* (x1(n)-x(j))/(x(i)-x(j));
  13. end
  14. end
  15. sum = sum + y(i)*il;
  16. end
  17. L(n) = sum;
  18. end
  19. vec = L;
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement