Dataset permute: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Jeremy
No edit summary
 
Line 2: Line 2:
Permute array dimensions of a DataSet object.
Permute array dimensions of a DataSet object.
===Synopsis===
===Synopsis===
x = permute(x,order);
:x = permute(x,order);
===Description===
===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.
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.  
PERMUTE is a generalization of TRANSPOSE (.') for N-D arrays.  
Example: The following demonstrates the permutation of a DataSet object, a:
 
===Example===
The following demonstrates the permutation of a DataSet object, a:
<pre>
>> a.data
>> a.data
ans(:,:,1) =
ans(:,:,1) =
Line 22: Line 25:
     30    40
     30    40
     30    40  
     30    40  
</pre>
===See Also===
===See Also===
[[dataset/transpose]]
[[dataset_transpose]]

Latest revision as of 17:07, 8 October 2008

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 

See Also

dataset_transpose