How to count a character string position?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Stephen23
il 25 Apr 2022
S = '00101100';
X = strfind(S,'1');
fprintf('The places with data are %s\n',join(string(X),", "))
0 Commenti
Più risposte (1)
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!