Create a single vector from the columns of a table.
UNRAVEL(a)
a |
- |
An array. |
A series.
W1: rand(10, 3)
W2: unravel(w1)
W1 contains a 10x3 array of random values. W2 contains a single 30 point series that is constructed by appending the rows of W1.
If W1 contains a 3 by 3 table, this expression returns a series with 9 observations; the elements of column 1 of W1, followed by the elements of column 2 of W1, followed by the elements of the last column of W1.
a = {{1, 2, 3},
{4, 5, 6},
{7, 8, 9}};
b = unravel(a);
b == {1, 4, 7, 2, 5, 8, 3, 6, 9}
Variable a is a 3X3 array. Variable b is a 9x1 series constructed by appending the rows of a.
UNRAVEL creates a single vector from an array by appending the columns of the array in order.
The A[..] syntax is equivalent to unravel(A). For example:
a = rand(10);
b = unravel(a);
c = a[..];
b == c