Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Matrices and Linear Algebra > Constructing Matrices > Band >
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Programming > Matrices and Linear Algebra > Constructing Matrices > Band >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Programming > Matrices and Linear Algebra > Constructing Matrices > Band >

Band

Band
represents the sequence of positions on the diagonal band that starts with in a sparse array.
Band
represents the positions between and .
Band
represents positions starting with and then moving with step .
  • Band[pos]->v represents values v that repeat along the diagonal band starting at pos.
  • Band[pos]->{v1, v2, ...} represents a sequence of values along the diagonal band starting at pos.
  • With an array a of the same rank as the whole sparse array, Band[start]->a by default inserts a at the position specified by start.
  • With arrays of the same rank as the whole sparse array, Band[pos]->{a1, a2, ...} represents a sequence of non-overlapping subarrays.
  • Band[start] is effectively equivalent to Band.
  • For scalar values, Band is equivalent to Band.
  • Band stops when any coordinate first exceeds its value in end.
  • Band[start, end]->{v1, v2, ...} takes the values to repeat cyclically until end is reached.
  • Band[start, Automatic, step]->a continues until the edge of the array is reached.
  • Band[start, Automatic, step]->{v1, v2, ...} continues until the are exhausted.
Create a band diagonal matrix:
Convert to normal lists:
Create a band diagonal matrix:
In[1]:=
Click for copyable input
Out[1]//MatrixForm=
Convert to normal lists:
In[2]:=
Click for copyable input
Out[2]=
Mix Band with other SparseArray element specifications:
Give explicit values to fill in on the band:
Repeat the values cyclically:
Start the band at any position in the matrix:
Specify any start and end locations:
Step by 2 between elements on the band:
Any step can be used:
Automatically continue the band to the edge of the array:
Specify a band that is part of a row:
Specify an anti-diagonal matrix:
Insert a submatrix beginning at position 3, 3:
Cyclically repeat the submatrix:
Alternate the submatrix with a single element:
Band works in sparse arrays of any rank:
Fill in a plane of values into a 3D sparse array:
Make a tridiagonal matrix:
Build a tridiagonal linear system:
Band works in SparseArray; use Normal to convert to normal lists:
The simplest case of Band is equivalent to DiagonalMatrix:
New in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF