Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский

Please note that the recommended version of Scilab is 6.0.1. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Elementary Functions > Elementary matrices > eye

eye

identity matrix

Calling Sequence

X = eye(m,n)
X = eye(A)
X = eye()

Arguments

A,X

matrices, hypermatrices, or syslin lists

m,n

integer values: numbers of rows and columns for X

Description

according to its arguments defines an mxn matrix with 1 along the main diagonal or an identity matrix of the same dimension as A . In case A is an hypermatrix, X will be defined as X(i,i,...,i) = 1 for all i from 1 to min(size(A)).

eye(10) is interpreted as eye(A) with A=10 i.e. 1. (It is NOT a ten by ten identity matrix!).

If A is a linear system represented by a syslin list, eye(A) returns an eye matrix of appropriate dimension: (number of outputs x number of inputs).

eye() produces a identity matrix with undefined dimensions. Dimensions will be defined when this identity matrix is added to a matrix with fixed dimensions.

Examples

eye(2,3)
A=rand(2,3);eye(A)
s=poly(0,'s');A=[s,1;s,s+1];eye(A)
A=[1/s,1;s,2];eye(A);
A=ssrand(2,2,3);eye(A)
[1 2;3 4]+2*eye()
eye(zeros(4,4,4,4))

See Also

  • ones — matrix made of ones
  • zeros — matrix made of zeros

History

VersionDescription
5.5.0

Generalization to N-D hypermatrix

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Apr 01 10:13:52 CEST 2015