Help required for sorting
古いコメントを表示
I have a table of size 17520X33 having multiple buyers' price and their required quantites.I want to arrange buyers based on price in desending order with ID. After arrange them in desending order i want to adjust their demand. Below is the segment of code which i am trying its arranges the prices well but the demand column is not adjusted accordingly. Any body can help me how i can do . Objective is arrange buyers based on prices indesending order than access their demands. Thanks
for i=1:17520
X(i,:)=buyer_price(i,:);
Y(i,:)=buyer_fl(i,:);
end
for i=1:17520
[sortedX(i,:), sortIndex(i,:)] = sort(X(i,:), 'descend');
sortedY=Y(sortIndexX);
end
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!