Borrar filtros
Borrar filtros

How do I plot d using Matlab

1 visualización (últimos 30 días)
dab483
dab483 el 12 de Feb. de 2014
Comentada: dab483 el 12 de Feb. de 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?

Respuesta aceptada

Mischa Kim
Mischa Kim el 12 de Feb. de 2014
Editada: Mischa Kim el 12 de Feb. de 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 comentario
dab483
dab483 el 12 de Feb. de 2014
yeah..i missing dot there. Got that. Thanks
i am running an EKF with d as disturbances.

Iniciar sesión para comentar.

Más respuestas (1)

Wayne King
Wayne King el 12 de Feb. de 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)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by