Legacy Documentation

Mathematica CalcCenter 2 (2002)

This is documentation for an obsolete product.
Current products and services

Documentation / CalculationCenter / Functions / Lists & Matrices / List Manipulation /

Part

FilledSmallSquare expr[[i]] or Part[expr, i] gives the part of expr.

FilledSmallSquare expr[[-i]] counts from the end.

FilledSmallSquare expr[[i, j, ... ]] or Part[expr, i, j, ... ] is equivalent to expr[[i]] [[j]] ... .

FilledSmallSquare expr[[{, , ... }]] gives a list of the parts , , ... of expr.

FilledSmallSquare You can make an assignment like t[[i]] = value to modify part of an expression.

FilledSmallSquare When expr is a list, expr[[{, , ... }]] gives a list of parts. In general, the head of expr is applied to the list of parts.

FilledSmallSquare You can get a nested list of parts from expr[[, , ... ]]. Each part has one index from each list.

FilledSmallSquare expr[[spec]] can be input as exprspec.

FilledSmallSquare and can be entered as AliasIndicator[[AliasIndicator and AliasIndicator]]AliasIndicator or \[LeftDoubleBracket] and \[RightDoubleBracket].

FilledSmallSquare expr[[spec]] can be input as or .

FilledSmallSquare See also: First, Last, Position, Take.

Examples

Using InstantCalculators

Here are the InstantCalculators for the Part function. Enter the parameters for your calculation and click Calculate to see the result.

In[1]:=

Out[1]=

In[2]:=

Out[2]=

Entering Commands Directly

You can paste a template for this command via the Text Input button on the Part Function Controller.

This finds the third element from the list using the shorthand notation for Part.

In[3]:=

Out[3]=

This pulls out a list of elements.

In[4]:=

Out[4]=

The second input resets the third element of the list using the special characters for Part.

In[5]:=

Out[5]=

In[6]:=

Out[6]=

In[7]:=

Out[7]=

Clear the variable definition.

In[8]:=



ja