This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
 BUILT-IN MATHEMATICA SYMBOL Tutorials »| See Also »| More About »

# MapAt

 MapAtapplies f to the element at position n in expr. If n is negative, the position is counted from the end. MapAtapplies f to the part of expr at position . MapAtapplies f to parts of expr at several positions.
• The list of positions used by MapAt is in the same form as is returned by the function Position. »
• MapAt applies f repeatedly to a particular part if that part is mentioned more than once in the list of positions. »
Map onto the part at position :
Map onto multiple parts:
Map onto a more deeply nested part:
Map onto the part at position :
 Out[1]=

Map onto multiple parts:
 Out[1]=

Map onto a more deeply nested part:
 Out[1]=
 Scope   (5)
A single element of the expression:
Negative numbers count from the end:
Map at a part at level 2:
Map at several elements:
Map at several nested parts:
MapAt can be used on expressions with any head:
The function can be mapped onto the heads as well:
Map can be used on sparse arrays:
 Applications   (4)
Reset an element in a matrix:
Reverse the sign of an element in a matrix:
Enumerate cases with mapped onto successive elements:
Reverse the color of a cell at a random position at each step:
MapAt can use lists of parts returned by Position:
These are the subexpressions returned by Extract:
MapAt applies repeatedly if a part is mentioned repeatedly:
New in 1