Mathematica 9 is now available

Part

Usage

expr[[i]] or Part[expr, i] gives the i part of expr.
expr[[-i]] counts from the end.
expr[[0]] gives the head of expr.
expr[[i, j, ... ]] or Part[expr, i, j, ... ] is equivalent to expr[[i]] [[j]] ... .
expr[[ { ,  , ... } ]] gives a list of the parts  ,  , ... of expr.


Notes

• You can make an assignment like t[[i]] = value to modify part of an expression.
• When expr is a list, expr[[ { ,  , ... } ]] gives a list of parts. In general, the head of expr is applied to the list of parts.
• You can get a nested list of parts from expr[[ ,  , ... ]]. Each part has one index from each list.
• If any of the  are All, all parts at that level are kept.
expr[[All, i]] effectively gives the i column in expr.
• Notice that lists are used differently in Part than in functions like Extract, MapAt and Position.
expr[[ Range[i, j] ]] can be used to extract sequences of parts.
• If expr is a SparseArray object, expr[[ ... ]] gives the parts in the corresponding ordinary array.
• In StandardForm and InputForm, expr[[spec]] can be input as expr spec .
 and  can be entered as AliasIndicator[[AliasIndicator and AliasIndicator]]AliasIndicator or \[LeftDoubleBracket] and \[RightDoubleBracket].
• In StandardForm, expr[[spec]] can be input as  or  .
• Related package: LinearAlgebra`MatrixManipulation`.
• New in Version 1; modified in 5.
• Advanced Documentation.


Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.