Settler
Structural
- May 22, 2010
- 88
I was asked to generate vector x(t), where x(t) is a rectangular pulse with width of 0.5 and period 1.
I wrote the following expression. The only thing is that I'm worried if it's a vector or not (as my English is bad).
fs = 1000; % sample freq
D = [0:1:4]'; % pulse delay times
t = 0 : 1/fs : 4000/fs; % signal evaluation time
w = 0.5; % width of each pulse
yp = pulstran(t,D,'rectpuls',w);
Thank you very much in advance!!
I wrote the following expression. The only thing is that I'm worried if it's a vector or not (as my English is bad).
fs = 1000; % sample freq
D = [0:1:4]'; % pulse delay times
t = 0 : 1/fs : 4000/fs; % signal evaluation time
w = 0.5; % width of each pulse
yp = pulstran(t,D,'rectpuls',w);
Thank you very much in advance!!