tridiag {mrbsizeR} | R Documentation |
Generate a tridiagonal matrix.
Description
Generate a tridiagonal matrix with upperDiag
as superdiagonal,
lowerDiag
as subdiagonal and mainDiag
as diagonal.
Usage
tridiag(mainDiag, upperDiag, lowerDiag)
Arguments
mainDiag |
Diagonal of tridiagonal matrix. |
upperDiag |
Superdiagonal of tridiagonal matrix. Must have length |
lowerDiag |
Subdiagonal of tridiagonal matrix. Must have length |
Value
Tridiagonal matrix.
Examples
set.seed(987)
mainDiag <- sample(100:110, size = 6, replace = TRUE)
upperDiag <- sample(10:20, size = 5, replace = TRUE)
lowerDiag <- sample(1:10, size = 5, replace = TRUE)
tridiag(mainDiag, upperDiag, lowerDiag)
[Package mrbsizeR version 1.3 Index]