function sorted = sortstudents(unsorted)
% Receive a vector of students as input
% Get scores of all the students

% Copyright 1984-2019 The MathWorks, Inc.
% All Rights Reserved.

scores = {unsorted.score};
% Convert the cell array containing scores into a numeric array or doubles
scores = cell2mat(scores);
% Sort the scores array
[s i] = sort(scores);
% Sort the students array based on the sorted scores array
sorted = unsorted(i);
