Clean solution to shrink matrices
4 views (last 30 days)
Pappu Murthy on 9 May 2017
I have pre-allocated a large Matrix X = (80000,8). for e.g zeros(80000,8); This I did for speed. After several operations I only filled say 1000 rows of the matrix and remaining are all zeros as I pre-allocated all elements to be zero to start with. Now I would like the shrink the matrix to smaller one by eliminating all the trivial rows in the end. What is the cleanest way of doing them?