Given a matrix A, and a matrix of column indices B, how to create a new matrix C from A and B
이전 댓글 표시
Consider the following 3 x 3 matrix A:
5 8 3
4 8 1
9 6 8
Consider the following 3 x 3 matrix B:
3 1 2
2 3 1
1 3 2
The rows of B contain the desired indexes of the rows of A. My goal is to create the matrix C:
3 5 8
8 1 4
9 8 6
So the rows of A are reshuffled according the indices in B. Any ideas on how to do this, preferably without loops?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!