extract multiple submatrices from a large matrix based on specific criterion

1 回表示 (過去 30 日間)
I have a Matrix A (162301x13 double) which first column contains 625 different ID numbers (they repeat that is why i have 162301 rows) and the other columns contain SL values for 12 different frequency values.
i need to extract submatrices from this large matrix for each unique ID value. For example (see attached), ID 23 contains 8 rows of values for the SLs columns and i want to extract this submatrix from the large matrix.
Any ideas?
Thanks

採用された回答

madhan ravi
madhan ravi 2019 年 5 月 14 日
編集済み: madhan ravi 2019 年 5 月 14 日
T=readtable('mydatfile.csv')% Note here it’s just your filename;
Wanted = T(T.id==23,:) %
  9 件のコメント
Priscilla Schmitz
Priscilla Schmitz 2019 年 5 月 14 日
Just one last question, how do I conver this multiple cell arrays (1x379) in multiple matrices?
madhan ravi
madhan ravi 2019 年 5 月 14 日
cat(3,Wanted{:}) % works only if each cell has same number of rows otherwise keeping it this way is the only option.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by