Can anyone help me with for loops in Matlab?
Show older comments
I am trying to write a program that uses selection sort to sort an array. I can't use sort or rowsort. I have to make my own function. A user will select a single column of the array to sort. That column will be sorted in ascending order. All rows should move with the selected column so that the original rows match the new sorted column.
My program is attached as well as a working program using the intrinsic functions of Matlab. So, far I can make this work until the eight value of the selected column and then the data is random. I think my for loops are incorrect can anyone help?
Accepted Answer
More Answers (0)
Categories
Find more on Shifting and Sorting Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!