sub2ind.m -- trying to use with a 2D matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a matrix
data = rand(100,100);
I also have a index into that matrix
IDY = randperm(100);
I wish to reorder the data matrix by the order in IDY.
I thought sub2ind could help me, but I have not been able to get it working.
FYI: the matrix is a correlation matrix. Each element refers to a variable. I wish to "re-order" the correlation matrix according to the ordering in IDY.
thank you
댓글 수: 0
답변 (2개)
Azzi Abdelmalek
2013년 11월 26일
편집: Azzi Abdelmalek
2013년 11월 26일
data(IDY)
Or maybe
data(IDY,:)
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!