spdiags {gallery} | R Documentation |
Create sparse diagonal matrix
Description
Creates a sparse representation of multiple diagonal matrix
Usage
spdiags(A, d, m, n)
Arguments
A |
matrix where columns correspond to the desired diagonals |
d |
indices of the diagonals to be filled in. 0 is main diagonal. -1 is first subdiagonal and +1 is first superdiagonal. |
m |
row dim |
n |
col dim |
Value
sparse diagonal matrix of class 'dgcMatrix'
[Package gallery version 1.0.0 Index]