Given matrix with so many zeroes, trim those zeroes and output a matrix joining all nnz elements
Example: input = [0 0 0 0 0; 0 2 0 4 0; 0 0 0 0 0; 0 1 0 3 0] output = [2 4; 1 3];
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers51
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3073 Solvers
-
634 Solvers
-
Return the first and last characters of a character array
12493 Solvers
-
Arrange vector in ascending order
836 Solvers
-
Sum positive elements of matrix.
131 Solvers
More from this Author43
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!