How to search for an exact string not just contains
243 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
the cyclist
il 12 Set 2020
Modificato: the cyclist
il 12 Set 2020
loc = {'Las Vegas, NV','North Las Vegas, NV'};
match = strcmp(loc,'Las Vegas, NV')
4 Commenti
Walter Roberson
il 12 Set 2020
I'm searching a cell array for an exact string
Use ismember()
7 Commenti
Walter Roberson
il 12 Set 2020
X = ismember((num),a));
1 1 0
2 -1
Count your open brackets.
Vedere anche
Categorie
Scopri di più su Cell Arrays in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!