Matchrows: Difference between revisions
Jump to navigation
Jump to search
imported>Scott (New page: ===Purpose=== Matches up rows from two DataSet objects using labels or sizes. ===Synopsis=== :[x,y] = matchrows(x,y) ===Description=== Given two input DataSet objects (x) and (y), MAT...) |
imported>Scott No edit summary |
||
Line 26: | Line 26: | ||
* Number of y columns vs. number of x rows (transpose y) | * Number of y columns vs. number of x rows (transpose y) | ||
* Number of y columns vs. number of x columns (transpose x and y) (where k is the number of modes of x or y) Multi-dimensional x and y are supported by all tests. | * Number of y columns vs. number of x columns (transpose x and y) (where k is the number of modes of x or y) Multi-dimensional x and y are supported by all tests. | ||
====Outputs==== | ====Outputs==== |
Revision as of 14:19, 7 October 2008
Purpose
Matches up rows from two DataSet objects using labels or sizes.
Synopsis
- [x,y] = matchrows(x,y)
Description
Given two input DataSet objects (x) and (y), MATCHROWS locates rows of (y) which match rows of (x) based on the labels in both objects and re-orders (y) to match (x). If (y) contains additional rows which match no rows of (x), they are dropped completely from the data. If some rows of (x) do not have matching (y) rows, the labels are not considered valid.
If no matching row labels are found, MATCHROWS searches other modes of x and y for matching labels. If no matching labels are found in any mode, sizes of the inputs are used to attempt a match.
The order of tests is:
- All label sets on mode 1 of both x and y
- All label sets on modes 2-k of y vs. mode 1 of x (transpose y)
- All label sets on modes 2-k of y vs. modes 2-k of x (transpose x and y)
- Number of y rows vs. number of x rows (no change)
- Number of y columns vs. number of x rows (transpose y)
- Number of y columns vs. number of x columns (transpose x and y) (where k is the number of modes of x or y) Multi-dimensional x and y are supported by all tests.
Outputs
Output DSOs are aligned (and possibly transposed) input DataSets.