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

2 vues (au cours des 30 derniers jours)
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

Réponse acceptée

Matt Fig
Matt Fig le 31 Oct 2012
Modifié(e) : Matt Fig le 31 Oct 2012
a = [7 8 9]
S = sprintf('%i,',a);
S = S(1:end-1)

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by