필터 지우기
필터 지우기

Create the rank in matlab

조회 수: 2 (최근 30일)
baby
baby 2012년 12월 16일
hi all,
i wanna ask to u how to create the rank in matlab
example in my case :
|data|score --> title
| a | 90 |
| b | 95 |
| c | 60 |
| d | 75 |
| e | 70 |
i wanna create a rank for the scores from the lowest score to the highest score, but i dont know how to make that
i wanna the result like this
|data|score|rank| --> title
| a | 90 | 4 |
| b | 95 | 5 |
| c | 60 | 1 |
| d | 75 | 3 |
| e | 70 | 2 |
u can see the rank from the lowest score to highest score.
this is my code
a= input ('The Amount of Data :');
for c=1:a
str1 = ['Input Sample's Name - ',num2str(c),' :'];
str2 = ['Input Score - ',num2str(c),' :'];
e{c,1} = input(str1,'s');
b{c,1} = input(str2);
end
d = cell2mat(b);
disp(d)
disp(e)
Please someone help me :'(
  댓글 수: 1
Jan
Jan 2012년 12월 16일
I cannot imagine what "|data|score --> title" should mean. In general inventing a new notation is only useful, if the details are explained.

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

답변 (1개)

Image Analyst
Image Analyst 2012년 12월 16일
Did you see sort(), particularly the second return argument?

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by