DSPRelated.com
Forums

How to plot a rectangular pulse waveform ?

Started by math...@hotmail.com November 1, 2006
Hi all out there!
I'm a newbie in this Discussion Group and beggining in matlab signal plotting and processing.
So, i need some help:

I want to plot a rectangular pulse with amplitude=1 in odd ranges (integer part) and amplitude=0 in even ranges.

Anyone can help me?

Thanks in advance.
Best Regards
Mathlop-

> I'm a newbie in this Discussion Group and beggining in matlab signal plotting and processing.
>
> So, i need some help:
>
> I want to plot a rectangular pulse with amplitude=1 in odd ranges (integer part) and amplitude=0 in even ranges.
>
> Anyone can help me?

I don't know MATLAB well enough to tap out code from my head, but I know if you code
this difference equation:

y[n] = d[n mod 2]

where d is delta step function, you will get 1 pulses whenever n is odd.

-Jeff