<< Expand SYMSCI Toolbox FreeSymbols >>

SYMSCI Toolbox >> SYMSCI Toolbox > Eye

Eye

symbolic identity matrix

Calling Sequence

B: Eye( A, k = 0 )
B: Eye( r, c, k = 0 )

Arguments

A

matrix of symbolic scalars

k

integer

r

non-negative integer

c

non-negative integer

B

matrix of symbolic scalars

Description

Eye( A )

Returns an identity matrix with the dimensions of matrix A.

Eye( A, k )

Returns a matrix with the dimensions of A and ones on a lower (k < 0) or upper (k > 0) diagonal. For k = 0 the ones are on the main diagonal (cf. above).

Eye( r, c )

Returns an identity matrix with r rows and c columns.

Eye( r, c, k )

Returns a matrix with r rows and c columns and ones on a lower (k < 0) or upper (k > 0) diagonal. For k = 0 the ones are on the main diagonal (cf. above).

Examples

// create a matrix
A = %(Mat("a",3,3))

// identity matrix
Eye(A)

// a band matrix with ones
Eye(7,5,-1)+Eye(7,5)+Eye(7,5,1)

// clean up
reset();
clear A;

See Also

Authors

Bibliography

SymEngine: C++ library for fast symbolic manipulation.


Report an issue
<< Expand SYMSCI Toolbox FreeSymbols >>