How to order a set of data from highest to lowest or lowest to highest?using FOR

2 ビュー (過去 30 日間)
Alejandra Graciano
Alejandra Graciano 2012 年 1 月 12 日
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

回答 (2 件)

John D'Errico
John D'Errico 2012 年 1 月 12 日
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.

Walter Roberson
Walter Roberson 2012 年 1 月 12 日

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by