Problem 44901. Rearrange the given matrix to have all its zeros climb up to the top of each column - using for loops.
Given a matrix x, using loops only return a matrix y, in which all the zeros have "climbed" up to the top. That is, any zeros in each column should be moved to the top without disturbing The order of the remaining nonzero numbers in the column.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers136
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15691 Solvers
-
378 Solvers
-
7746 Solvers
-
Find the square of the sum of the digits of a number
157 Solvers
-
Sum of adjacent elements in a vector
581 Solvers
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!