Documentation for jbiu/

Generated by IDLdoc

single page | use frames     summary     class     fields     routine details     file attributes

misc/

multi2index.pro


top source multi2index

Misc

result = multi2index(subscripts, dimensions)

Translates multidimensional indices into flat indices (the inverse of ARRAY_INDICES).

Return value

Flat indices into an array with the given dimensions.

Parameters

subscripts in

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 in

An array containing the length of each dimension in the multidimensional array.

Examples

If a is an LxMxN array, the following expressions are equivalent: a[sub1, sub2, sub3] a[ multi2index([sub1, sub2, sub3], [L, M, N]) ]

Author information

History:

Written by: Jeremy Bailin 12 June 2008 Public release in JBIU 26 May 2010 Added /INTEGER keyword to PRODUCT and TOTAL calls.

File attributes

Modification date: Wed May 26 08:53:52 2010
Lines: 58