Square Wave Generator

版本 1.3.0.0 (1.7 KB) 作者: John Pritchard
Generate an array of values that represent a square wave.
836.0 次下载
更新时间 2011/11/5

查看许可证

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);

引用格式

John Pritchard (2024). Square Wave Generator (https://www.mathworks.com/matlabcentral/fileexchange/33622-square-wave-generator), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.3.0.0

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

1.2.0.0

Examples in file description appropriately updated.

1.0.0.0