I have this sparse matrix of the following form
Lets take an example of 5x10 matrix
1 2 3 4 5 6 7 8 9 10
1 1 1 0 0 0 0 0 0 0 0
2 0 1 0 0 0 0 0 0 0 0
3 .............................
4 .............................
5 .............................
From this sparse matrix, I want to create a cell array C of form
C{1} 1
C{2} = [1,2]
...........
...........
...........
My sparse matrix is high dimensional like 40000 by 790000. How can I do it efficiently in matlab. I can definitely use a loop and do it inefficiently. But I want the most efficient. Suggestions?