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 Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by