冲激函数
x=-5:0.01:5;%x从-5每隔0.01取样到5
y=0*(x>=-5&x<0)+2*(x==0)+0*(x>0&x<=5);%只有当x=0时y才为2
plot(x,y);...
axis([-5,5,-1,3]);
阶跃函数
syms x; %定义变量x
y=heaviside(x-1); %heaviside,单位阶跃函数
fplot(y);...
axis([0,2,-1,2]);
正弦函数:
syms x; %定义变量x
y=sin(x); %sin函数,正弦函数
fplot(y);…
axis([0,2*pi,-1.5,1.5]); %定义范围
指数函数:
syms t; %定义自变量t
fplot(exp(-2*t),[-2,2]); %绘制t范围为【-2,2】的指数函数,用exp函数
周期三角波和锯齿波:
x=linspace(0,2*pi,100); %设定x的范围
y=sawtooth(x); %锯齿形函数
plot(x,y); hold on;
f=sawtooth(x,