|
|
单位阶越:
, B* h: X. \& V( Ufunction [x,n] = stepseq(n0,n1,n2)4 N* f3 C3 i! T3 V, P7 a0 g
% Generates x(n) = u(n-n0); n1 <= n,n0 <= n2
+ x1 \4 J2 c' f% ------------------------------------------
2 c* {/ l$ L: W& f% [x,n] = stepseq(n0,n1,n2)& }; k2 y. @ w3 z! l+ E. v
%
, \+ c3 O a6 I% b% U8 q6 pif ((n0 < n1) | (n0 > n2) | (n1 > n2))
' j! b, ^% `' O" k error('arguments must satisfy n1 <= n0 <= n2')
3 c( F$ Y* Q/ \. @$ k* z7 K: f% Hend
4 n' _! h8 i) `$ on = [n1:n2];: m5 ?2 M8 x; K/ l; P
%x = [zeros(1,(n0-n1)), ones(1,(n2-n0+1))];
' l, w, `7 l' n0 jx = [(n-n0) >= 0]; |
|