MapIndexed
MapIndexed[
f
,
expr
] applies f to the elements of expr, giving the part specification of each element as a second argument to f. MapIndexed[
f
,
expr
,
levspec
] applies f to all parts of expr on levels specified by levspec.
Example: MapIndexed[f,
a, b, c
]
. The default value for levelspec in MapIndexed is {1}. Example: MapIndexed[f,
a, b
,
c, d
, Infinity]
. See The Mathematica Book on the web:Section 2.2.4.
Further Examples
|
|
|
|
 |
|
|