MULTI2INDEX
Name
MULTI2INDEX
Purpose
Translates multidimensional indices into flat indices (the inverse
of ARRAY_INDICES).
Category
Misc
Calling Sequence
Result = MULTI2INDEX(Subscripts, Dimensions)
Inputs
Subscripts: Multidimensional indices. If Dimensions has D
elements, then Subscripts is a DxQ dimensional
array to translate Q sets of indices. Q may be
1 (or, equivalently, missing).
Dimensions: An array containing the length of each dimension in
the multidimensional array.
Outputs
Flat indices into an array with the given dimensions.
Example
If a is an LxMxN array, the following expressions are equivalent:
a[sub1, sub2, sub3]
a[ multi2index([sub1, sub2, sub3], [L, M, N]) ]
Modification History
Written by: Jeremy Bailin
12 June 2008 Public release in JBIU
26 May 2010 Added /INTEGER keyword to PRODUCT and TOTAL calls.