How to count a character string position?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Stephen23
le 25 Avr 2022
S = '00101100';
X = strfind(S,'1');
fprintf('The places with data are %s\n',join(string(X),", "))
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!