How do I access entries in a table that match a string?

1 回表示 (過去 30 日間)
Pratik Samant
Pratik Samant 2020 年 2 月 28 日
編集済み: Jeff Miller 2020 年 2 月 29 日
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

採用された回答

Jeff Miller
Jeff Miller 2020 年 2 月 29 日
編集済み: Jeff Miller 2020 年 2 月 29 日
This should work:
wantedRows = ismember(A.ProxID,nameFolds);
wantedZones = A.zone(wantedRows);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by