Search for a specific string in a dataset
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Nurul Ain
el 19 de Mzo. de 2014
Comentada: Nurul Ain
el 19 de Mzo. de 2014
Hi all,
I have a dataset (SDEV) with 4 columns (ID,Name,ImageFile,Tel). I try to create a new dataset with only ID and Name for all data with ImageFile contains only word 'fixed'. My ImageFile contains very long string like 'document/test/fixed/image/001_controlled', 'document/test/shaked/image/001_controlled', etc.
I code like this:
load SDev;
h1 =SDev(SDev.ID==3 & SDev.ImageFile=='.*fixed*',{'ID' 'Name'})
and it gave me error: Undefined function 'eq' for input arguments of type 'cell'.
Thank you in advance.
0 comentarios
Respuesta aceptada
Image Analyst
el 19 de Mzo. de 2014
It probably doesn't like this SDev.ImageFile=='.*fixed*'
ImageFile might be a cell. And you should use strcmpi() instead o f== for comparing strings
strcmpi(char(SDev.ImageFile), '.*fixed*')
Más respuestas (0)
Ver también
Categorías
Más información sobre Color 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!