Generating Discrete time Rectangular wave
3 次查看(过去 30 天)
显示 更早的评论
I would like to generate rectangular wave through matrices. I am able to generate triangular signal by :
tri=[0 1/3 2/3 1 2/3 1/3 0 0];
Any idea on how to generate a rectangular wave in this method? thanks.
0 个评论
回答(1 个)
Azzi Abdelmalek
2013-4-20
t=-10:0.01:10;
y=heaviside(t+5)-heaviside(t-5),
plot(t,y)
1 个评论
Azzi Abdelmalek
2013-4-20
If you do not have heaviside function use
t=-10:0.01:10;
echelon=@(x) (1+sign(x))/2
y=echelon(t+5)-echelon(t-5),
plot(t,y)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!