Skip to Main Content Skip to Search
Product Documentation

shiftdim - Class: categorical

Shift dimensions of categorical array

Syntax

B = shiftdim(A,n)
[B,nshifts] = shiftdim(A)

Description

B = shiftdim(A,n) shifts the dimensions of the categorical array A by N. When n is positive, shiftdim shifts the dimensions to the left and wraps the n leading dimensions to the end. When n is negative, shiftdim shifts the dimensions to the right and pads with singletons.

[B,nshifts] = shiftdim(A) returns the array B with the same number of elements as A but with any leading singleton dimensions removed. nshifts returns the number of dimensions that are removed. If A is a scalar, shiftdim has no effect.

See Also

circshift | reshape | squeeze

  


 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS