Band
Band[{i,j}]
represents the sequence of positions on the diagonal band that starts with {i,j} in a sparse array.
Band[{imin,jmin,…},{imax,jmax,…}]
represents the positions between {imin,jmin,…} and {imax,jmax,…}.
Band[{imin,jmin,…},{imax,jmax,…},{di,dj,…}]
represents positions starting with {imin,jmin,…} and then moving with step {di,dj,…}.
Details
- Band[pos]->v represents values v that repeat along the diagonal band starting at pos.
- Band[pos]->{v1,v2,…} represents a sequence of values vn 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 an 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[start,{-1,-1,…}].
- For scalar values, Band[start,end] is equivalent to Band[start,end,{1,1,…}].
- Band[start,end,step] stops when any coordinate first exceeds its value in end.
- Band[start,end]->{v1,v2,…} takes the values vn 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 vi are exhausted.
Examples
open allclose allScope (11)
Mix Band with other SparseArray element specifications:
Give explicit values to fill in on the band:
Start the band at any position in the matrix:
Specify any start and end locations:
Step by 2 between elements on the band:
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:
Generalizations & Extensions (2)
Properties & Relations (2)
Band works in SparseArray; use Normal to convert to normal lists:
The simplest case of Band is equivalent to DiagonalMatrix:
Text
Wolfram Research (2007), Band, Wolfram Language function, https://reference.wolfram.com/language/ref/Band.html.
CMS
Wolfram Language. 2007. "Band." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Band.html.
APA
Wolfram Language. (2007). Band. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Band.html