Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

eye

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

Examples

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

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.