Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. t = 0:0.2:25
  2. speed1 = (0.1553567.*t.^6 - 2.0416.*t.^5 + 9.1837.*t.^4 - 14.829.*t.^3 - 1.3703.*t.^2 + 32.821.*t - 1.3155)
  3. speed2 = 0.003980879.*t.^5 - 0.2247.*t.^4 + 4.8682.*t.^3 - 50.442.*t.^2 + 254.67.*t - 430.66
  4. speed3 = -0.073.*t.^2 + 6.1802.*t + 40.423
  5.  
  6. Indexing and extracting values for t < 5
  7. idxlt5 = t < 5
  8. tlt5 = t(idxlt5)
  9. speedlt5 = speed1(idxlt5)
  10.  
  11. Indexing and extractiving values for 5 =< t < 15.4
  12. idxlt154 = t < 15.4
  13. tlt154 = t(idxlt154)
  14. speedlt154 = speed2(idxlt154)
  15.  
  16. Indexing and exctracting values for 15.4 <= t <= 25
  17. idxlt25 = t <= 25
  18. tlt25 = t(idxlt25)
  19. speedlt25 = speed3(idxlt25)
  20.  
  21. Plotting
  22. plot(tlt5,speedlt5)
  23. ylim([0 150])
  24. hold on
  25. plot(tlt154,speedlt154)
  26. plot(tlt25,speedlt25)
  27. hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement