I have a vector with classificaition points of various cars and I want to list that classification, how can I do that?
1 回表示 (過去 30 日間)
古いコメントを表示
So let me explain. I have a vector with points corresponding to vehicles, for example:
vehicle 1= 200 pts vehicle 2= 190 pts vehicle 3= 300 pts, so the vector is points=[200;190;300].
The car with more points wins so I want to find a vector [2;3;1], in this case vehicle 1 is in second place, vehicle 2 is third place and vehicle 3 is in first place.
How can I do that?
Thanks
0 件のコメント
採用された回答
Image Analyst
2013 年 3 月 24 日
Try this:
points=[200, 190, 300] % Sample data.
[sortedPoints, sortOrder] = sort(points, 'descend')
for car = 1 : length(sortOrder)
carsPosition(car) = find(sortOrder == car);
end
% Show in command window:
carsPosition
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Vehicle Network Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!