Index table with cell array
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kim Maria Damiani
el 19 de Nov. de 2021
Respondida: Stephen23
el 19 de Nov. de 2021
I have a table in which one of the columns is a cell array of text data, and a cell array C that contains a subset of this text. Is there a way to extract from the table only the rows with the text in C?
0 comentarios
Respuesta aceptada
Stephen23
el 19 de Nov. de 2021
Where T is your table and C is your cell array:
idx = ismember(T.NameOfVariable, C)
out = T(idx,:)
0 comentarios
Más respuestas (1)
Matt J
el 19 de Nov. de 2021
Yes, you can use ismember(...,'rows') to find the indices of the rows.
3 comentarios
Ver también
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!