how to process in descending order

Sir I have done as per your command,but please tell how to do it in descending order,I used the word descend ,but it showed an error ,please can u help
data = reshape({5 'R' 3 'E' 1 'A' 4 'P'},2,[])' out = sortrows(data,1)
or
out = reshape(sortrows(data,1)',1,[])
if
data(:,1)=cellfun(@num2str,data(:,1),'un',0) out = sortrows(data,1)

 채택된 답변

Oleg Komarov
Oleg Komarov 2011년 9월 15일

0 개 추천

out = flipud(sortrows(data,1))

추가 답변 (2개)

Andrei Bobrov
Andrei Bobrov 2011년 9월 15일

2 개 추천

out = sortrows(data,-1)

댓글 수: 2

Andrei Bobrov
Andrei Bobrov 2011년 9월 15일
read it http://www.mathworks.com/matlabcentral/answers/15896-how-to-sort-data
Oleg Komarov
Oleg Komarov 2011년 9월 15일
I completely forgot about the -1, +1!

댓글을 달려면 로그인하십시오.

the cyclist
the cyclist 2011년 9월 15일

0 개 추천

When you included the word "descend", did you include it in single quotes, like this:
>> sort(x,'descend')
Maybe you should show what you tried, and tell us the error message you got.

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

Pat
2011년 9월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by