Find indexes of string elements inside another string
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Eduard Mazur
am 12 Aug. 2019
Kommentiert: Eduard Mazur
am 12 Aug. 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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 12 Aug. 2019
Bearbeitet: Walter Roberson
am 12 Aug. 2019
[~, B_index] = ismember(B,A)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!