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

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개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

태그

질문:

2012년 10월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by