Effacer les filtres
Effacer les filtres

How do I plot d using Matlab

1 vue (au cours des 30 derniers jours)
dab483
dab483 le 12 Fév 2014
Commenté : dab483 le 12 Fév 2014
I have this:
d(:,:,i) = 0.005*sin(0.5*pi*t(i))*cos(0.5*pi*t(i))
i=1:Nt
t = linspace(0,100,Nt+1)
Nt=1000
How do I plot d using Matlab?

Réponse acceptée

Mischa Kim
Mischa Kim le 12 Fév 2014
Modifié(e) : Mischa Kim le 12 Fév 2014
Use
Nt = 1000
t = linspace(0,100,Nt+1)
d = 0.005*sin(0.5*pi*t).*cos(0.5*pi*t)
plot(t,d)
Any reason you are using a 3-dimensional array d ?
  1 commentaire
dab483
dab483 le 12 Fév 2014
yeah..i missing dot there. Got that. Thanks
i am running an EKF with d as disturbances.

Connectez-vous pour commenter.

Plus de réponses (1)

Wayne King
Wayne King le 12 Fév 2014
Not sure why you are trying to construct your signal like this. Take advantage of MATLAB's vector operations.
Nt = 100;
t = linspace(0,100,Nt);
d = 0.005*sin(0.5*pi*t)+cos(0.5*pi*t);
plot(t,d)

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by