Mathematica 9 is now available

Part

Usage

expr[[i]] Part[expr, i] 给出expri 分量。
expr[[-i]] 从结尾开始记数。
expr[[0]] 给出expr的头。
expr[[i, j, ... ]]Part[expr, i, j, ... ]等于 expr[[i]] [[j]] ... .
expr[[   ,  , ...  ]] 给出expr ,  , ... 分量列表。


Notes

• 可以进行象 t[[i]] = value 的赋值来修改一个表达式的一部分。
• 当expr是一个列表, expr[[   ,  , ...  ]] 给出分量列表。通常,expr的头应用到分量列表。
• 可以从expr[[ ,  , ... ]]中得到一个分量的嵌套列表。每个分量都有一个指标。
• 如果任何 All,那层的所有的分量被保持。
expr[[All, i]]有效的给出expr中的 i 列。
• 注意在Part中使用的列表和在象 Extract, MapAtPosition中的函数不同。
expr[[ Range[i, j] ]] 可以用于提取分量序列。
• In StandardFormInputForm, expr[[spec]] 可以输出为 expr spec .
  可以输入为 AliasIndicator[[AliasIndicatorAliasIndicator]]AliasIndicator 或 \[LeftDoubleBracket]和 \[RightDoubleBracket]
• 在StandardForm, expr[[spec]]可以输入为   .
• 参见 Mathematica 全书: 1.2.4, 节 1.2.4, 节 1.4.7, 节 1.8.4, 节 1.8.4 and 节 2.1.4.
Further Examples

This finds the third element of the list.

In[1]:=  

Out[1]=

This pulls out a list of elements.

In[2]:=  

Out[2]=

Here is a list.

In[3]:=  

Out[3]=

This resets the third element.

In[4]:=  

Out[4]=

In[5]:=  

Out[5]=

Here is a matrix.

In[6]:=  

This picks out columns  and  of the matrix.

In[7]:=  

Out[7]=

In[8]:=  



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.