Convert string form to array form on Matlab

How to convert string form into array and from array to string on Matlab?
exam : '1234' ---> [1 2 3 4]
[1 2 3 4] --> '1234'

답변 (2개)

madhan ravi
madhan ravi 2019년 5월 29일

0 개 추천

sprintf('%d',1234)
str2double('1234')
Jan
Jan 2019년 5월 29일

0 개 추천

[1 2 3 4] --> '1234' :
x = [1,2,3,4]
s = sprintf('%d', x)
'1234' ---> [1 2 3 4] :
s = '1234';
x = s - '0'

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

질문:

2019년 5월 29일

답변:

Jan
2019년 5월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by