Sort Except Zeros - MATLAB Cody - MATLAB Central

Problem 51620. Sort Except Zeros

Difficulty:Rate
Sort the numbers in a vector. But the position of zeros should not be changed.
Example: sort_except_zeros( [5 3 0 0 2 4] ) == [2 3 0 0 4 5]

Solution Stats

67.31% Correct | 32.69% Incorrect
Last Solution submitted on Jun 26, 2025

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers34

Suggested Problems

More from this Author53

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!