commutation Basic functions dblist

Grocer >> Basic functions > crlag

crlag

circular lag function

CALLING SEQUENCE

[y]=crlag(x,n)

PARAMETERS

Input

• x = input vector (tx1) or (1xt)

• n = # of values to return (optional; default=t)

Output

• y = a (nx1) (if x is (1xt)) or a (1xn) (if x is (1xt))vector with:

  * y(1) = x(n)

  * y(2) = x(1)

• …

  * y(n) = x(n-1)

DESCRIPTION

Circular lag function

EXAMPLE

y=crlag([1:5]) 

// returns: y=[5 1 2 3 4]

AUTHOR

Eric Dubois 2002
commutation Basic functions dblist