How to search for an exact string not just contains
241 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hiyah
I'm searching a cell array for an exact string, e.g the data I am searching contains both 'Las Vegas, NV' and 'North Las Vegas, NV' and I want specifically the coordinats of 'Las Vegas, NV'
the code I've used so far is:
Y = ~cellfun('isempty',strfind(cellstr(num),'Las Vegas, NV'));
(then [row col] = find(Y==1) )
how do I modify?
Thanks alot !
0 comentarios
Respuestas (2)
the cyclist
el 12 de Sept. de 2020
Editada: the cyclist
el 12 de Sept. de 2020
loc = {'Las Vegas, NV','North Las Vegas, NV'};
match = strcmp(loc,'Las Vegas, NV')
4 comentarios
Walter Roberson
el 12 de Sept. de 2020
I'm searching a cell array for an exact string
Use ismember()
7 comentarios
Ver también
Categorías
Más información sobre Cell Arrays en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!