Celll and Structure Array
조회 수: 6 (최근 30일)
이전 댓글 표시
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
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!