How to order a set of data from highest to lowest or lowest to highest?using FOR
2 views (last 30 days)
Show older comments
I have to order a set of data from highest to lowest or lowest to highest using the FOR random data can be I can not use the max command
Thanks for your help
0 Comments
Answers (2)
John D'Errico
on 12 Jan 2012
Don't you think you should be doing your own homework? Really, you gain more by doing it yourself.
Ok. Just this once, I'll do it for you. This solution employs for but not max.
for i = 1:1
M = sort(dataset(:),'ascend');
end
Enjoy. I'll let you figure out how to do it in descending order.
0 Comments
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!