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

1 visualización (últimos 30 días)
Pratik Samant
Pratik Samant el 28 de Feb. de 2020
Editada: Jeff Miller el 29 de Feb. de 2020
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

Respuesta aceptada

Jeff Miller
Jeff Miller el 29 de Feb. de 2020
Editada: Jeff Miller el 29 de Feb. de 2020
This should work:
wantedRows = ismember(A.ProxID,nameFolds);
wantedZones = A.zone(wantedRows);

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by