How to count a character string position?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Emily
am 25 Apr. 2022
Beantwortet: Stephen23
am 25 Apr. 2022
I have a character string with 00101100
There is data where there is 1 and nothing in 0.
I wanted to it to display the places with the datas.
For example "The places with data are 3, 5, 6"
0 Kommentare
Akzeptierte Antwort
Stephen23
am 25 Apr. 2022
S = '00101100';
X = strfind(S,'1');
fprintf('The places with data are %s\n',join(string(X),", "))
0 Kommentare
Weitere Antworten (1)
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!