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

1 次查看(过去 30 天)
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

采纳的回答

Matt Fig
Matt Fig 2012-10-31
编辑:Matt Fig 2012-10-31
a = [7 8 9]
S = sprintf('%i,',a);
S = S(1:end-1)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by