ConcatRows

Revision as of 21:27, 24 November 2009 by Max (talk | contribs) (→‎Examples)


ConcatRows( A ; rowIndex,colIndex, ,concatIndex )

Takes an array, A indexed by rowIndex and colIndex, and concatenates each row, henceforth flattening the array by one dimension. The result is indexed by concatIndex, which must be an index with Size(rowIndex) * Size(colIndex) elements.

As of Analytica 4.2, concatIndex is optional. If not specified, ConcatRows creates a local index with the name .ConcatIndex to dimension the result.

Library

In Analytica 4.2 and later, this function is a built-in function, in the Array library.

In Analytica 4.0 and 4.1, this function is located in the "Concatenation.ana" library. To use that function, you must add the library to your model.

Examples

Let

    A:=
J
1 2 3 4
I 1 'a' 'b' 'c' 'd'
2 'e' 'f' 'g' 'h'
ConcatRows(A,I,J)
.ConcatIndex: 1 2 3 4 5 6 7 8
'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'
ConcatRows(A,J,I)
.ConcatIndex: 1 2 3 4 5 6 7 8
'a' 'e' 'b' 'f' 'c' 'g' 'd' 'h'

To flatten three dimensions, I1, I2 and I3, use:

Var tmp := ConcatRows(A,I1,I2) Do ConcatRows(tmp,tmp.ConcatIndex,I3)

See Also

Comments


You are not allowed to post comments.