Using strfind to find character index in word
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
hi, i have a script where i must find the index of the letter e in the word each
Guess1 = e;
HangWord = "each"
index = strfind(HangWord, 'Guess1')
this returns index=[]
thank you
0 Kommentare
Antworten (2)
Stephen23
am 16 Sep. 2019
>> HangWord = 'each';
>> Guess1 = 'e';
>> index = strfind(HangWord, Guess1)
index = 1
0 Kommentare
Walter Roberson
am 16 Sep. 2019
Guess1 = 'e';
HangWord = "each";
index = strfind(HangWord, Guess1);
0 Kommentare
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!