Student[LinearAlgebra]
BandMatrix
construct a band Matrix
Calling Sequence
Parameters
Description
Examples
BandMatrix(L, n, options)
L

list of lists of scalars or list of scalars or Vector of scalars; diagonals of the band Matrix
n
(optional) nonnegative integer; the number of subdiagonals
options
(optional) parameters; for a complete list, see LinearAlgebra[BandMatrix]
The BandMatrix(L) command constructs a band Matrix from the data provided by L.
If L is a list of lists, then each list element in L is used to initialize a diagonal. The $n+1$st element of L is placed along the main diagonal. (If L has fewer than n+1 elements, it is automatically extended by [0]'s.) The other diagonals are placed in relation to it: ${L}_{nj+1}$ is placed in the jth subdiagonal for $j=1..n$ and ${L}_{n+k+1}$ is placed in the kth superdiagonal for $k=1..\mathrm{nops}\left(L\right)n1$. If any list element is shorter than the length of the diagonal where it is placed, the remaining entries are filled with 0.
If n is omitted in the calling sequence, BandMatrix attempts to place an equal number of sub and superdiagonals into the resulting Matrix by using $n=\mathrm{iquo}\left(\mathrm{nops}\left(L\right)\,2\right)$ subdiagonals.
If L is a list or Vector of scalars, its elements are used to initialize all the entries of the corresponding diagonals. In this case, parameter n must be specified in the calling sequence. If the row dimension r is not specified, it defaults to n+1. If the column dimension is not specified, it defaults to the row dimension. The jth subdiagonal is filled with L[nj+1] for j = 1 .. n. (If L has fewer than n+1 elements, it is automatically 0extended.) The main diagonal is filled with L[n + 1]. The kth superdiagonal is filled with L[n + k + 1] for k = 1 .. nops(L) n  1.
$\mathrm{with}\left(\mathrm{Student}\left[\mathrm{LinearAlgebra}\right]\right)\:$
$\mathrm{LL}\u2254\left[\left[w\,w\right]\,\left[x\,x\,x\right]\,\left[y\,y\,y\right]\,\left[z\,z\right]\right]\:$
$\mathrm{BandMatrix}\left(\mathrm{LL}\right)$
$\left[\begin{array}{ccc}{y}& {z}& {0}\\ {x}& {y}& {z}\\ {w}& {x}& {y}\\ {0}& {w}& {x}\end{array}\right]$
$\mathrm{BandMatrix}\left(\mathrm{LL}\,1\right)$
$\left[\begin{array}{cccc}{x}& {y}& {z}& {0}\\ {w}& {x}& {y}& {z}\\ {0}& {w}& {x}& {y}\end{array}\right]$
$\mathrm{BandMatrix}\left(\u27e81\,2\u27e9\,3\right)$
$\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {2}& {0}& {0}& {0}\\ {1}& {2}& {0}& {0}\end{array}\right]$
See Also
LinearAlgebra[BandMatrix]
Download Help Document
What kind of issue would you like to report? (Optional)