Impulse, Step, and Ramp Functions

Since MATLAB® is a programming language, an endless variety of different signals is possible. Here are some statements that generate a unit impulse, a unit step, a unit ramp, and a unit parabola.

t = (-1:0.01:1)'; impulse = t==0; unitstep = t>=0; ramp = t.*unitstep; quad = t.^2.*unitstep;

All of these sequences are column vectors that inherit their shapes from t . Plot the sequences.

plot(t,[impulse unitstep ramp quad])

Generate and plot a square wave with period 0.5 and amplitude 0.81.

sqwave = 0.81*square(4*pi*t); plot(t,sqwave)

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Select a Web Site Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe