Generating Discrete time Rectangular wave
조회 수: 16 (최근 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!