Advertisement
Guest User

Untitled

a guest
Apr 1st, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. Q1)
  2. x = [0 1 2 2 3];
  3. y = [1 3 3 4 5];
  4. t = [0 1 2 3 4];
  5. Rx = 0:0.001:4;
  6. Rt = spline(t,x, Rx);
  7. St = spline(t,y, Rx);
  8. figure
  9. %plot(Rx, Rt);
  10. %plot(Rx, St);
  11. plot(Rt, St);
  12. xlabel('x'), ylabel('t')
  13. grid on
  14.  
  15. Q1b)
  16. x = [2.75 1.3 -0.25 0.0 0.25 -1.3 -2.5 -1.3 0.25 0.0 -0.25 1.3 2.75];
  17. y = [-1.0 -0.75 0.8 2.0 0.8 -0.25 0.0 0.25 -1.3 -2.5 -1.3 -0.25 -1.0];
  18. t = 0:12
  19. Rx = 0:0.001:12;
  20. Rt = spline(t,x, Rx);
  21. St = spline(t,y, Rx);
  22. figure
  23. %plot(Rx, Rt);
  24. %plot(Rx, St);
  25. plot(Rt, St);
  26. xlabel('x'), ylabel('t'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement