Celll and Structure Array

6 次查看(过去 30 天)
TRAVIS
TRAVIS 2013-4-17
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.

回答(1 个)

Jan
Jan 2013-4-17
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.

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by