index and matrix selection
15 ビュー (過去 30 日間)
古いコメントを表示
Hi,
my index matrixis size(index)=118*4. the data matrix is size(data)=2970290*9
iwa nt to select just index-data.
i wrote this:
data_new=data([index],:). the size of this matrix is:472*9.
I want to get the matrix with the size 118*36. I dont want to use reshape. do you know something better than my statement (data_new=data([index],:))
Thanks
0 件のコメント
採用された回答
José-Luis
2012 年 11 月 12 日
cell2mat(arrayfun(@(x) {data(x,:)},index,'uniformoutput',false));
Using reshape should be faster though.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!