making a time vector

44 ビュー (過去 30 日間)
Daniel Sifuentes
Daniel Sifuentes 2019 年 2 月 5 日
回答済み: KSSV 2019 年 2 月 5 日
2. Create vectors of data a) Create a vector (t) that contains time from 0 seconds to 3 seconds, with a step-size of 0.01 seconds. b) Create a vector (y) that contains the position values for ?(?) = 5 ∙ sin(4? ∙ ?) in meters. c) Create a vector (vel) that contains the velocity values for ?(?) = 20? ∙ ???(4? ∙ ?) in m/s.
3. Plot data a) Make separate plots of y vs. t and vel vs. t. Use pauses in between plots. Make sure to include: i. Appropriate graph title ii. Axis labels and units b) Make a single plot of y vs. t and vel vs. t on the same graph. Make y a solid red line and vel a dashed blue line. Make sure to include: i. Appropriate graph title ii. Axis labels and units (you may simply label the y-axis as Amplitude) iii. Legend (now that multiple lines are on the graph). Your legend should identify the plot of y as position (m) and the plot of vel as velocity (m/s)
  1 件のコメント
KSSV
KSSV 2019 年 2 月 5 日
Home Work..wher is your attempt?

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

回答 (1 件)

KSSV
KSSV 2019 年 2 月 5 日
a) Create a vector (t) that contains time from 0 seconds to 3 seconds, with a step-size of 0.01 seconds.
Read about linspace.
b) Create a vector (y) that contains the position values for ?(?) = 5 ∙ sin(4? ∙ ?) in meters.
Direct substituion, it is easy.
t = 0:0.001:10 ;
y = 5*sin(4*pi-t) ;
plot(t,y)
c) Create a vector (vel) that contains the velocity values for ?(?) = 20? ∙ ???(4? ∙ ?) in m/s.
Same as above
Plot data a) Make separate plots of y vs. t and vel vs. t.
Read about plot

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by