Create a string from array by concatenating array elements separated by comma.

2 visualizaciones (últimos 30 días)
I have an array like a=[ p q r]. I want to convert the array to a string like s='p,q,r'.Can any one help me please?
Thanks,Tapas

Respuesta aceptada

Matt Fig
Matt Fig el 31 de Oct. de 2012
Editada: Matt Fig el 31 de Oct. de 2012
a = [7 8 9]
S = sprintf('%i,',a);
S = S(1:end-1)

Más respuestas (0)

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by