eye: Some Basic Matrices

View source: R/eye.R

eyeR Documentation

Some Basic Matrices

Description

Create basic matrices.

Usage

eye(n, m = n)
ones(n, m = n)
zeros(n, m = n)

Arguments

m, n

numeric scalars specifying size of the matrix

Value

Matrix of size n x m. Defaults to a square matrix if m is missing.

No dropping of dimensions; if n = 1, still returns a matrix and not a vector.

See Also

Diag,

Examples

eye(3)
ones(3, 1)
zeros(1, 3)

pracma documentation built on March 19, 2024, 3:05 a.m.