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

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 26 日
編集済み: Azzi Abdelmalek 2013 年 11 月 26 日

0 投票

data(IDY)
Or maybe
data(IDY,:)
Sean de Wolski
Sean de Wolski 2013 年 11 月 26 日

0 投票

data(IDY,:)
To reorder all rows or for columns
data(:,IDY)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2013 年 11 月 26 日

回答済み:

2013 年 11 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by