Difference between revisions of "MdArrayToTable"
m (fixed link) |
m (Fixed table headers) |
||
Line 38: | Line 38: | ||
{| border="1" | {| border="1" | ||
|+ Rows v, Cols >> | |+ Rows v, Cols >> | ||
− | Mpg Time Car_type Cost | + | !Mpg !!Time !!Car_type !!Cost |
|- | |- | ||
!1 ||26 ||0 ||VW ||2185 | !1 ||26 ||0 ||VW ||2185 |
Revision as of 22:57, 2 February 2007
MdArrayToTable(A,I,L)
Transforms a multi-dimensional array, A, into a two-dimensional array (i.e., a table) indexed by I and L. The result contains one row along I for each element of A. L must contain a list of names of the indexes of A, followed by one final element. All elements of L must be text values. The column corresponding to the final element of L contains the cell value. If L does not contain all the indexes of A, array abstraction will create a set of tables indexed by the dimensions not listed in L.
Transforms a multi-dimensional array, A, into a two-dimensional array (i.e., a table) indexed by I and L. The result contains one row along I for each element of A. L must contain a list of names of the indexes of A, followed by one final element. All elements of L must be text values. The column corresponding to the final element of L contains the cell value. If L does not contain all the indexes of A, array abstraction will create a set of tables indexed by the dimensions not listed in L.
If the number of elements in I is equal to the number of nonzero elements of A, MDArrayToTable() acts like the inverse of MdTable( ) on a table that contains a row for only the nonzero elements of the array.
Library
Array
Example
Rows := sequence(1,size(Cost_in_time)) Cols := [‘Mpg’,’Time’,’Car_type’,’Cost’]
MDArrayToTable(Cost_in_time,Rows,Cols) →
Mpg | Time | Car_type | Cost | |
---|---|---|---|---|
1 | 26 | 0 | VW | 2185 |
2 | 26 | 0 | Honda | 2385 |
3 | 26 | 0 | BMW | 3185 |
4 | 26 | 1 | VW | 2294 |
5 | 26 | 1 | Honda | 2314 |
6 | 26 | 1 | BMW | 3294 |
7 | 26 | 2 | VW | 2409 |
... | ||||
45 | 35 | 4 | BMW | 5175 |
Enable comment auto-refresher