I appreciate if anyone could help me with this problem
Show older comments
I have a list of students , every student has a grade (numeric value)
how can i order the list of those students according to their marks ,
so that the first one in the list is the one who has the highest grade
for example (let's assume that the grades are between 0 and 20)
Alex: 19
Morgan: 12
Erik: 15
Montana:13
Molko:10
Kelsie:16
the list should be lik that
Alex Kelsie Erik Montana Morgan
2 Comments
Raj
on 19 Apr 2019
Problem statement is pretty straightforward. What exactly is the issue here? Can you share what you have tried so far on this?
Abdelmalek Benaimeur
on 19 Apr 2019
Accepted Answer
More Answers (1)
madhan ravi
on 19 Apr 2019
1 vote
Hint: Use sort().
2 Comments
Abdelmalek Benaimeur
on 19 Apr 2019
madhan ravi
on 19 Apr 2019
Edited: madhan ravi
on 19 Apr 2019
Just use a cell array to contain each name and corresponding grades in each row of the cell array . Sort the grades which is in the second column. Assign the second output of sort as the row subscript for the cell array thereby sorting your cell array according to the given homework. If you are still not able to figure out, post the code that you tried to get further help.
Categories
Find more on Direction of Arrival Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!