Basic question again : How plot a finite length rectangular pulse

조회 수: 3 (최근 30일)
Im trying to plot this signal: x(n)=1 for n=2:4 . I tried by rectpuls :
figure
n=2:4;
y=rectpuls(n);
stem (y);
But surprisingly I get 0 for all three samples of y. Is there any other way to do that? (Ive found that if I write y=rectpuls(n)+1 , it works. However I don't want to cheat and manipulate the code!)
Thanks a lot for any help !

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 9월 17일
n=2:4;
y=ones(1,numel(n))
stem(n,y)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by