How do I split double-digit elements in a vector into two separate elements?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a vector, v = [1 18 9 8], and I'm trying to split up the 18 into two separate elements so that the new vector would be new_vec = [1 1 8 9 8]. Any ideas on how to approach this?
댓글 수: 0
답변 (2개)
Andrei Bobrov
2016년 11월 28일
편집: Andrei Bobrov
2016년 11월 28일
v = [1 18 9 8];
new_vec = sprintf('%d',v)-'0';
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Assembly에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!