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!