eye: MATLAB eye function

Description Usage Arguments Value Author(s) See Also Examples

View source: R/eye.R

Description

Create an identity matrix.

Usage

1
eye(m, n)

Arguments

m, n

numeric scalar specifying dimensions for the result

Value

Returns matrix of order 1. Defaults to square if second dimension argument n not provided.

Author(s)

P. Roebuck [email protected]

See Also

ones, zeros

Examples

1
eye(3)

Example output

Attaching package: 'matlab'

The following object is masked from 'package:stats':

    reshape

The following objects are masked from 'package:utils':

    find, fix

The following object is masked from 'package:base':

    sum

     [,1] [,2] [,3]
[1,]    1    0    0
[2,]    0    1    0
[3,]    0    0    1

matlab documentation built on May 30, 2017, 6:57 a.m.