how do i split every digit of a string
조회 수: 1 (최근 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!