rect pulse in matlab

Status
Not open for further replies.

rameshrai

Full Member level 3
Joined
Aug 16, 2010
Messages
158
Helped
7
Reputation
14
Reaction score
7
Trophy points
1,298
appliedelectronicsengineering.blogspot.com
Activity points
2,272
Hi,

I want to generate a rectangular pulse of the figure as attached. I tried various functions available in matlab(pulstran, rectpuls) and code available on the internet but could not produce it.

The last code I tried-

fs = 0.25; % sample freq
D = [0 4 8]'; % pulse delay times
t = 0 : 1/fs : 25/fs; % signal evaluation time
w = 2; % width of each pulse
yp = pulstran(t,D,@rectpuls,w);
plot(t,yp)



please have a look
thanks
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…