Find matched string in table
古いコメントを表示
Hi,
To find data matching certain conditions in a table we use:
rows = (T.Smoker==true & T.Age<40);
What if the T.Smoker field was not a logical but a string? 'yes' or 'no'.
rows = (T.Smoker=='yes' & T.Age<40);
This later code does not work. How could I make it work so the condition matches a certain string?
Thank you,
TD
採用された回答
その他の回答 (2 件)
Image Analyst
2020 年 3 月 9 日
Try contains:
rows = contains(T.Smoker, 'yes') & T.Age<40;
1 件のコメント
The Finnish Rein Deer
2020 年 3 月 10 日
カテゴリ
ヘルプ センター および File Exchange で Characters and Strings についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!