SPEYE SPEYE Sparse Identity Matrix Usage Creates a sparse identity matrix of the given size. The syntax for its use is y = speye(m,n) which forms an m x n sparse matrix with ones on the main diagonal, or y = speye(n) which forms an n x n sparse matrix with ones on the main diagonal. The matrix type is a float single precision matrix.