<< moc_cholinv Matlab/Octave Compatibility toolbox moc_columns >>

Matlab/Octave Compatibility toolbox >> Matlab/Octave Compatibility toolbox > moc_circshift

moc_circshift

Circularly shift the values of the array x

Calling Sequence

y = moc_circshift (x, n)

Description

Circularly shift the values of the array x. n must be a vector of integers no longer than the number of dimensions in x. The values of n can be either positive or negative, which determines the direction in which the values or x are shifted. If an element of n is zero, then the corresponding dimension of x will not be shifted.

Examples

x = [1, 2, 3; 4, 5, 6; 7, 8, 9];
moc_circshift (x, 1)
ans  =

7.    8.    9.
1.    2.    3.
4.    5.    6.
moc_circshift (x, -2)
ans  =

7.    8.    9.
1.    2.    3.
4.    5.    6.

moc_circshift (x, [0,1])
ans  =

3.    1.    2.
6.    4.    5.
9.    7.    8.

Authors


Report an issue
<< moc_cholinv Matlab/Octave Compatibility toolbox moc_columns >>