<< round | Elementary functions | sign >> |
B = shiftdim(A, n) |
B = shiftdim(A) |
[B, m] = shiftdim(A) |
Input array: vector, matrix or multidimensional array.
Number of positions: integer value.
vector, matrix, or multidimensional array.
Number of dimensions removed: non-negative integer.
shiftdim(A, n) reorganizes the dimensions of an array A by n positions.
Specifically, when n is a positive integer, it shifts the dimensions to the left, and when n is a negative integer, it shifts the dimensions to the right.
A = rand(2, 3, 4);
size(A)
% Shift the dimensions of array A by 2 positions to the left
B = shiftdim(A, 2)
Version | Description |
---|---|
1.3.0 | initial version |
Allan CORNET