Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear
- clc
- x = 0:6;
- y = [0 .8415 .9093 .1411 -.7568 -.9589 -.2794];
- n = length(x);
- xL = linspace(0,6,606);
- yI = zeros(1,length(xL));
- c = 1;
- for i = 1:n-1
- eqn = [ (y(i+1)-y(i))/(x(i+1)-x(i)) (x(i+1)*y(i)-x(i)*y(i+1))/(x(i+1)-x(i)) ];
- for xx = x(i):.01:x(i+1)
- yI(c) = polyval(eqn,xx);
- c=c+1;
- end
- end
- plot(x,y,'o');
- hold on;
- plot(xL,yI);
- xp=2.5;
- grid;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement