speye
A sparse identity matrix.
(u)=speye(m)
(u)=speye(m,n)
Inputs
m Number of rows in the sparse matrix to be constructed.
n Number of columns in the sparse matrix to be constructed.
u The sparse idenetity matrix.


Description
If only m is specified, an mXm matrix is returned. Otherwise, an mXn matrix is returned. In both cases, the only nonzero elements are ones on the main diagonal.
Example
>>speye(10)
        ( 1, 1)    1.0000
        ( 2, 2)    1.0000
        ( 3, 3)    1.0000
        ( 4, 4)    1.0000
        ( 5, 5)    1.0000
        ( 6, 6)    1.0000
        ( 7, 7)    1.0000
        ( 8, 8)    1.0000
        ( 9, 9)    1.0000
      ( 10, 10)    1.0000

>>speye(10,9)
        ( 1, 1)    1.0000
        ( 2, 2)    1.0000
        ( 3, 3)    1.0000
        ( 4, 4)    1.0000
        ( 5, 5)    1.0000
        ( 6, 6)    1.0000
        ( 7, 7)    1.0000
        ( 8, 8)    1.0000
        ( 9, 9)    1.0000