How to incorporate velocities when plotting

4 ビュー (過去 30 日間)
Salvie Morales
Salvie Morales 2019 年 12 月 9 日
回答済み: Salvie Morales 2019 年 12 月 10 日
A bus starts at the location (0.5, 0.5) at time 0. Write the MatLab code to plot map of the distance that the bus will travel in 30 minutes (see the figure below). Use a time step of 1 minute to run the 30-minute simulation. The bus is traveling 95 km/hr in the north direction for the first 3 minutes. The bus is traveling at 75 km/hr in the eastern direction for the next 7 minutes. For the rest of the simulation, the bus is traveling at 100 km/hr in the southern direction. Include code to plot the distance versus time. Your output should look like the graph below.
I know I need to put the x and y directions into arrays to tarck them but I can't figure out how to incorporate the veocities into the coding. Any ideas?
thanks!
  1 件のコメント
Raj
Raj 2019 年 12 月 10 日
編集済み: Raj 2019 年 12 月 10 日
"how to incorporate the veocities into the coding" - You have to calculate distance from the velocity and time provided in the question for each direction. Then plot the distance vs time graph for the whole trip.

サインインしてコメントする。

回答 (1 件)

Salvie Morales
Salvie Morales 2019 年 12 月 10 日
Thank you!

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by