Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [ vec ] = minterp1( x,y,x1 )
- l = length(x);
- L = zeros(length(x1),1);
- for n=1:length(x1)
- sum = 0;
- for i=1:l
- il=1;
- for j=1:l
- if j ~= i
- il=il* (x1(n)-x(j))/(x(i)-x(j));
- end
- end
- sum = sum + y(i)*il;
- end
- L(n) = sum;
- end
- vec = L;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement