Creating new dataset corresponding to certain name within a variable column
1 回表示 (過去 30 日間)
古いコメントを表示
I have a dataset with four columns: day, bottle, species finalC. Attached is a screenshot for reference. In the bottle column, there are many types of bottle names I reference. I wish to create a new dataset corresponding only to a specific name of bottle, for example "C-a"
Desired outcome looks as follows:
day bottle species finalC
1 'C-a' 'Colp' 1077.58620700000
2 'C-a' 'Colp' 86525.1499800000
2 'C-a' 'Colp' 208333.333300000
0 件のコメント
回答 (1 件)
the cyclist
2019 年 3 月 22 日
Here is one possible way. (It assumes your table's variable name is tbl.)
outcome = tbl(ismember(tbl.bottle,'C-a'),:);
参考
カテゴリ
Help Center および File Exchange で Red についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!