matlab sort排序后,利用索引返回到原序列。
3 ビュー (過去 30 日間)
古いコメントを表示
果博东方开户经理【微8785092】
2023 年 5 月 17 日
回答済み: 果博东方现场客服【微8785092】
2023 年 5 月 17 日
% matlab sort排序后,利用索引返回到原序列
A=[ 15 3 5 7 2 1 12 17]
[sA index]=sort(A)
AA=sA(index)
%论坛上说这样可以,很明显。这样不对。求大神指点
A =
15 3 5 7 2 1 12 17
sA =
1 2 3 5 7 12 15 17
index =
6 5 2 3 4 7 1 8
AA =
12 7 2 3 5 15 1 17
0 件のコメント
採用された回答
果博东方现场客服【微8785092】
2023 年 5 月 17 日
应该写成AA(index)=sA
A=[ 15 3 5 7 2 1 12 17]
[sA index]=sort(A)
AA(index)=sA
这样就好了吧
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!