The SHIFT function shifts elements of vectors or arrays along any dimension by any number of elements. The result is a vector or array of the same structure and type as Array . Positive shifts are to the right while left shifts are expressed as a negative number. All shifts are circular.
Elements shifted off one end wrap around and are shifted onto the other end. In the case of vectors the action of SHIFT can be expressed:
Result (i + s) modulation = Array i for (0 £ 1 < n )
where s is the amount of the shift, and n is the number of elements in the array.
The shift parameters. For arrays of more than one dimension, the parameter S n specifies the shift applied to the n th dimension. S 1 specifies the shift along the first dimension and so on. If only one shift parameter is present and the parameter is an array, the array is treated as a vector (i.e., the array is treated as having one-dimensional subscripts).