Code covered by the BSD License  

Highlights from
Square Wave Generator

Be the first to rate this file! 20 Downloads (last 30 days) File Size: 1.65 KB File ID: #33622
image thumbnail

Square Wave Generator

by

 

04 Nov 2011 (Updated )

Generate an array of values that represent a square wave.

| Watch this File

File Information
Description

This is a simple function that returns an array of values that represent a square wave based on two essential inputs (total time and period) and four optional inputs (plot option, minimum amplitude, maximum amplitude, and resolution).

[f] = squareWave(time,per,plotChk,Amin,Amax,res)

Units are arbitrary, but time and amplitude are assumed.

The following examples illustrate its use:

[y] = squareWave(10,1);
    OR
[y] = squareWave(10,1,1);
    OR
[y] = squareWave(10,1,-1,1);
    OR
[y] = squareWave(10,1,-1,1,1);
    OR
[y] = squareWave(10,1,-1,1,1,1e5);

Required Products MATLAB
MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
04 Nov 2011

Examples in file description appropriately updated.

05 Nov 2011

Updated examples in help section of M-file to be more intuitive.

Contact us