Sorting of numbers in MATLAB

Sorting of any numbers in ascending or descending order by using nested for-end loops.


Updated 15 Jan 2022

View License

For details watch the lecture:
Enter the set of numbers in an array: [ 2 3 1 5 -1.3 7.5]
The required ascending order is:
-1.300 1.000 2.000 3.000 5.000 7.500
The required descending order is:
7.500 5.000 3.000 2.000 1.000 -1.300

Cite As

Dr. Manotosh Mandal (2023). Sorting of numbers in MATLAB (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes