How to convert a vector to a string (Matlab2016a)

50 visualizaciones (últimos 30 días)
Sara
Sara el 12 de Dic. de 2020
Comentada: dpb el 12 de Dic. de 2020
hi everyone,
i want to convert a vector to a string, how can i do it in matlab2016a
for example A = [ 1 2 3]
thanks in advance

Respuestas (1)

dpb
dpb el 12 de Dic. de 2020
For what definition of "string"?
>> A=1:3;
>> num2str(A)
ans =
'1 2 3'
>> num2str(A.')
ans =
3×1 char array
'1'
'2'
'3'
>> string(A) % requires R2016b
ans =
1×3 string array
"1" "2" "3"
>>

Categorías

Más información sobre Characters and Strings en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by