RM_trid: Generate a tridiagonal matrix with normal entries

Description Usage Arguments Value Examples

View source: R/matrices.R

Description

Generate a tridiagonal matrix with normal entries

Usage

1
RM_trid(N, symm = FALSE)

Arguments

N

number of dimensions of the square matrix

symm

indicates whether the matrix should be symmetric; equal to its transpose.

Value

A random tridiagonal matrix with N(0,2) diagonal and N(0,1) band.

Examples

1
2
3
4
5
# Generate a 3x3 standard normal tridiagonal matrix
P <- RM_trid(N = 3)

# Symmetric tridiagonal matrix
P <- RM_trid(N = 9, symm = TRUE)

RMAT documentation built on April 28, 2021, 9:06 a.m.