Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = 0:0.2:25
- 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)
- speed2 = 0.003980879.*t.^5 - 0.2247.*t.^4 + 4.8682.*t.^3 - 50.442.*t.^2 + 254.67.*t - 430.66
- speed3 = -0.073.*t.^2 + 6.1802.*t + 40.423
- Indexing and extracting values for t < 5
- idxlt5 = t < 5
- tlt5 = t(idxlt5)
- speedlt5 = speed1(idxlt5)
- Indexing and extractiving values for 5 =< t < 15.4
- idxlt154 = t < 15.4
- tlt154 = t(idxlt154)
- speedlt154 = speed2(idxlt154)
- Indexing and exctracting values for 15.4 <= t <= 25
- idxlt25 = t <= 25
- tlt25 = t(idxlt25)
- speedlt25 = speed3(idxlt25)
- Plotting
- plot(tlt5,speedlt5)
- ylim([0 150])
- hold on
- plot(tlt154,speedlt154)
- plot(tlt25,speedlt25)
- hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement