Celll and Structure Array
6 views (last 30 days)
Show older comments
I would like to use the 'sort' and 'pickOne' functions to get the strikeouts along with the player that made the said strikeouts for the TOP 20 PLAYERS. For some reason, the code I wrote is only giving me the strikeouts, it is not telling me who the player is that made the strikeout. Any suggestions would be appreciated.
Here goes:
[sorted,indexes]=sort(strikeouts,'descend');
for r=1:20
sorted(r)
players=pickOne(M,'playerID',{ M.playerID })
end
%%like I said, this code is only giving me the top 20 strikeouts in descending order, it is not telling me who the player is that made said strikeout.
0 Comments
Answers (1)
Jan
on 17 Apr 2013
You do not use the obtained variable indexes at all, but most likely it is required to determine the player also. As long, as we do not know how the players are represented in yout program, any suggestion would be a bold guessing only, and therefore it could be more confusing than helpful.
0 Comments
See Also
Categories
Find more on Matrix Indexing 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!