How do I plot d using Matlab
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Mischa Kim
2014-2-12
编辑:Mischa Kim
2014-2-12
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 个)
Wayne King
2014-2-12
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)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!