how do i split every digit of a string
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
その他の回答 (1 件)
Walter Roberson
2012 年 11 月 24 日
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'
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!