Find indexes of string elements inside another string
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Eduard Mazur
il 12 Ago 2019
Commentato: Eduard Mazur
il 12 Ago 2019
Hello
I have two strings like:
A=["a" "b" "c" "d" "e" "f" "g"]
B=["b" "d" "f" "a"]
How can I know that elements in B inside A is B_index=[2 4 6 1]?
Thanks for helping!
0 Commenti
Risposta accettata
Walter Roberson
il 12 Ago 2019
Modificato: Walter Roberson
il 12 Ago 2019
[~, B_index] = ismember(B,A)
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!