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?

 Akzeptierte Antwort

Mischa Kim
Mischa Kim am 12 Feb. 2014
Bearbeitet: Mischa Kim am 12 Feb. 2014

0 Stimmen

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 Kommentar

dab483
dab483 am 12 Feb. 2014
yeah..i missing dot there. Got that. Thanks
i am running an EKF with d as disturbances.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Wayne King
Wayne King am 12 Feb. 2014

0 Stimmen

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)

Tags

Gefragt:

am 12 Feb. 2014

Kommentiert:

am 12 Feb. 2014

Community Treasure Hunt

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

Start Hunting!

Translated by