How do I access entries in a table that match a string?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a table, A, which is 112x5 table in size and consists of both strings and numbers. (shown below)
I also have a 99x1 cell, nameFolds, which is a series of labels for the entries in a that I'm interested in. namefolds is shown below
What I want to do is extract the 'zone' label from A, for all entries matching nameFolds. I tried to start this using boolean expressions but was given an error saying "Undefined operator '==' for input
arguments of type 'cell'".
Thanks
댓글 수: 0
채택된 답변
Jeff Miller
2020년 2월 29일
편집: Jeff Miller
2020년 2월 29일
This should work:
wantedRows = ismember(A.ProxID,nameFolds);
wantedZones = A.zone(wantedRows);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!