Indexing in Sparse Matrix Operations
Because sparse matrices are stored in compressed sparse column format, there are different costs associated with indexing into a sparse matrix than there are indexing into a full matrix. For example, consider the 4-by-4 identity matrix:
A=eye(4);
To replace the 2,1 entry with the number 3, you would do this: