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'

Respuestas (2)

Jan
Jan el 29 de Mayo de 2019
[1 2 3 4] --> '1234' :
x = [1,2,3,4]
s = sprintf('%d', x)
'1234' ---> [1 2 3 4] :
s = '1234';
x = s - '0'

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Preguntada:

el 29 de Mayo de 2019

Respondida:

Jan
el 29 de Mayo de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by