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

조회 수: 2 (최근 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