I define a sparse identity matrix, using the SPEYE command as follows:
A = speye(5)
and receive the following output:
A = (1,1) 1 (2,2) 1 (3,3) 1 (4,4) 1 (5,5) 1
I would like to write the non-zero elements as well as the row and column information corresponding to the non-zero elements to a text file.
Best Answer