Index table with cell array
17 ビュー (過去 30 日間)
古いコメントを表示
I have a table in which one of the columns is a cell array of text data, and a cell array C that contains a subset of this text. Is there a way to extract from the table only the rows with the text in C?
0 件のコメント
採用された回答
Stephen23
2021 年 11 月 19 日
Where T is your table and C is your cell array:
idx = ismember(T.NameOfVariable, C)
out = T(idx,:)
0 件のコメント
その他の回答 (1 件)
Matt J
2021 年 11 月 19 日
Yes, you can use ismember(...,'rows') to find the indices of the rows.
3 件のコメント
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!