Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. x = [-2 -1 0 1 2]
  2.  
  3. -8 3 -5 6 6]
  4.  
  5. a polyfit (x, y, 4)
  6. x1 linspace (-2,2)
  7. yl polyval (a,x1)
  8. %Lagrange interpolation
  9.  
  10. 1
  11.  
  12. t = [ 00102091 ]
  13. al polyfit (t,x, 4)
  14. a2 polyfit (t,y, 4)
  15. t1 linspace (0,1)
  16. x2 polyval (al, t1)
  17. y2= polyval (a2, t1)
  18. plot (x2,42, xl, yl,X,Y,'*')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement