Mathematica 9 is now available
 Documentation /  Mathematica /  The Mathematica Book /  Advanced Mathematics in Mathematica /  Linear Algebra /

Constructing MatricesScalars, Vectors and Matrices

3.7.2 Getting Pieces of Matrices

Ways to get pieces of matrices.

Matrices in Mathematica are represented as lists of lists. You can use all the standard Mathematica list-manipulation operations on matrices.

Here is a sample matrix.

In[1]:= t = Array[a, {3, 3}]

Out[1]=

This picks out the second row of the matrix.

In[2]:= t[[2]]

Out[2]=

Here is the second column of the matrix.

In[3]:= t[[All, 2]]

Out[3]=

This picks out a submatrix.

In[4]:= Take[t, {1, 2}, {2, 3}]

Out[4]=

Constructing MatricesScalars, Vectors and Matrices



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.