信号的产生——rectpuls 函数
信号的产生——rectpuls函数,功能:产生非周期方波信号,其调用格式如下:
(1)y=rectpuls(t),
(2)y=rectpuls(t,w),产生指定宽度为w的非周期方波。
% E_2_13_rectpuls.m
clc
clear
close all
t = -2:0.001:2;
y = rectpuls(t);
subplot(121); plot(t,y);
axis([-2 2 -1 2]); grid on;
xlabel('t'); ylabel('h(t)');
y = 2*rectpuls(t,2);%产生指定宽度为2的非周期方波.
subplot(122); plot(t,y);
axis([-2 2 -1 3]); grid on;
xlabel('t'); ylabel('h(t)');
title('E_2_13_rectpuls非周期方波信号');