How to reverse the operation?
    6 ビュー (過去 30 日間)
  
       古いコメントを表示
    
採用された回答
  Jan
      
      
 2022 年 4 月 7 日
        A = [1 2 5 4 3];
B = [2 5 1];
AA = A;
for i = 1:numel(B)
  AA([i, B(i)]) = AA([B(i), i]);
end
AA
for i = numel(B):-1:1
  AA([i, B(i)]) = AA([B(i), i]);
end
AA
その他の回答 (0 件)
参考
カテゴリ
				Help Center および File Exchange で Data Import from MATLAB についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!