DOCUMENTATION CENTER SEARCH
Mathematica
>
Parts of Matrices
>
Built-in
Mathematica
Symbol
DiagonalMatrix
Tr
Band
See Also »
|
Matrices and Linear Algebra
Parts of Matrices
New in 6.0: List Manipulation
New in 6.0: Matrix & Linear Algebra Functions
More About »
Diagonal
Diagonal
[
m
]
gives the list of elements on the leading diagonal of the matrix
m
.
Diagonal
[
m
,
k
]
gives the elements on the
k
diagonal of
m
.
MORE INFORMATION
Diagonal
[
m
]
works even if
m
is not a square matrix.
For positive
k
,
Diagonal
[
m
,
k
]
gives diagonals above the leading diagonal.
Diagonal
[
m
, -
k
]
gives diagonals below.
EXAMPLES
CLOSE ALL
Basic Examples
(3)
Give the diagonal elements of a matrix:
In[1]:=
Out[1]=
Give diagonals one element above and below the leading diagonal:
In[1]:=
Out[1]=
In[2]:=
Out[2]=
Give a diagonal of a nonsquare matrix:
In[1]:=
Out[1]=
Neat Examples
(1)
SEE ALSO
DiagonalMatrix
Tr
Band
MORE ABOUT
Matrices and Linear Algebra
Parts of Matrices
New in 6.0: List Manipulation
New in 6.0: Matrix & Linear Algebra Functions
New in 6
© 2008 Wolfram Research, Inc.