making a time vector

42 vues (au cours des 30 derniers jours)
Daniel Sifuentes
Daniel Sifuentes le 5 Fév 2019
Réponse apportée : KSSV le 5 Fév 2019
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 commentaire
KSSV
KSSV le 5 Fév 2019
Home Work..wher is your attempt?

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 5 Fév 2019
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

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by