Learn R Programming

ADtools (version 0.5.4)

Diagonal: Diagonal matrix

Description

Diagonal matrix

Usage

Diagonal(n, x = NULL)

Arguments

n

integer; the dimension of the square matrix.

x

A scalar or a vector to be placed on the diagonal of the matrix.

Examples

Run this code
# NOT RUN {
Diagonal(3)
Diagonal(3, 999)
Diagonal(3, c(11, 22, 33))

# }

Run the code above in your browser using DataLab