Dataset transpose: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Jeremy No edit summary |
||
Line 2: | Line 2: | ||
Performs a transpose (rows become columns and columns become rows) on a two-way DataSet object. | Performs a transpose (rows become columns and columns become rows) on a two-way DataSet object. | ||
===Synopsis=== | ===Synopsis=== | ||
x = x'; | :x = x'; | ||
===Description=== | ===Description=== | ||
Returns the transposed DataSet object x in which rows are now columns and vice versa (mode 1 becomes mode 2 and mode 2 becomes mode 1). All fields are transposed as necessary. This specific command only operates on vector and two-way DataSet objects. To modify multi-way DataSet objects (more than 2 modes), use the PERMUTE method. | Returns the transposed DataSet object x in which rows are now columns and vice versa (mode 1 becomes mode 2 and mode 2 becomes mode 1). All fields are transposed as necessary. This specific command only operates on vector and two-way DataSet objects. To modify multi-way DataSet objects (more than 2 modes), use the PERMUTE method. | ||
Example | |||
===Example=== | |||
The following demonstrates the transpose of a DataSet object, a: | |||
<pre> | |||
>> a.data | >> a.data | ||
ans = | ans = | ||
Line 15: | Line 18: | ||
1 30 | 1 30 | ||
2 40 | 2 40 | ||
</pre> | |||
===See Also=== | ===See Also=== | ||
[[ | [[dataset_permute]] |
Revision as of 16:22, 8 October 2008
Purpose
Performs a transpose (rows become columns and columns become rows) on a two-way DataSet object.
Synopsis
- x = x';
Description
Returns the transposed DataSet object x in which rows are now columns and vice versa (mode 1 becomes mode 2 and mode 2 becomes mode 1). All fields are transposed as necessary. This specific command only operates on vector and two-way DataSet objects. To modify multi-way DataSet objects (more than 2 modes), use the PERMUTE method.
Example
The following demonstrates the transpose of a DataSet object, a:
>> a.data ans = 1 2 30 40 >> a=a'; >> a.data ans = 1 30 2 40