1. 单位样本序列

δ(nn0)={1,n=n00,nn0

function [x, n] = impseq(n0, n1, n2)
n = n1:n2;
x = [n == n0];

2. 单位阶跃信号

u(nn0)={1,nn00,n<n0

function [x, n] = stepseq(n0, n1, n2)
n = n1:n2;
x = [n >= n0];