Dataset permute
From Eigenvector Documentation Wiki
Contents |
Purpose
Permute array dimensions of a DataSet object.
Synopsis
- x = permute(x,order);
Description
Rearranges the dimensions of x so that they are in the order specified by the vector order. The DataSet produced has the same values of x but the order of the subscripts needed to access any particular element are rearranged as specified by order. The elements of order must be a rearrangement of the numbers from 1 to N (where N is the number of modes of x). All informational fields are also reordered as necessary. PERMUTE is a generalization of TRANSPOSE (.') for N-D arrays.
Example
The following demonstrates the permutation of a DataSet object, a:
>> a.data
ans(:,:,1) =
1 30
2 40
ans(:,:,2) =
1 30
2 40
>> a=permute(a,[3 1 2]);
>> a.data
ans(:,:,1) =
1 2
1 2
ans(:,:,2) =
30 40
30 40