|
|
单位阶越:
3 D8 V2 `8 w% O* m# Ofunction [x,n] = stepseq(n0,n1,n2)
, l" {7 p. a$ P/ Q9 W( w4 c$ a& P0 F% Generates x(n) = u(n-n0); n1 <= n,n0 <= n2& w! Y, \" r5 `" t5 x
% ------------------------------------------
. l( N ]; k6 ^ u* Q1 f: w' [% [x,n] = stepseq(n0,n1,n2)1 B+ E9 U' z+ E" j" ]- T2 x
%" B& n3 w$ I) a: g4 ?- c7 @
if ((n0 < n1) | (n0 > n2) | (n1 > n2)): ?$ d+ l8 [/ O# Q$ d# K+ }' M
error('arguments must satisfy n1 <= n0 <= n2')
/ Q) F! d7 C2 k- Iend
- U6 N; q5 i- f4 S% p1 d, an = [n1:n2];
+ \5 j0 @6 l& y0 U o% t- t%x = [zeros(1,(n0-n1)), ones(1,(n2-n0+1))];
5 z9 c( u/ t# D8 J+ vx = [(n-n0) >= 0]; |
|