Advertisement
encoree1996

Untitled

Jun 15th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. x = [5,-4,-3,0,2];
  2. xi = -4:0.1:2;
  3. y = [8,-5,16,-2,-1];
  4. i1 = interp1(x,y,xi,'cubic');
  5. i2 = interp1(x,y,xi,'linear');
  6. i3 = interp1(x,y,xi,'spline');
  7. plot(xi,i1,xi,i2,'r-')
  8. hold on
  9. plot(xi,i3,'b-',x,y,'Og')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement