how do i split every digit of a string
Ältere Kommentare anzeigen
i have a string as '1111' how to split its digit as
num(1)=1
num(2)=1
num(3)=1
num(4)=1
I will always have numbers only in the string
thanks in advance
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 24 Nov. 2012
num = '1111'
then
num(1) would be '1'
If you need num(1) to be numeric 1 rather than the character 1, then
num = '1111' - '0'
1 Kommentar
Sharen H
am 24 Nov. 2012
Kategorien
Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!