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

arrayMATLABstrings

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

Best Answer

a = [7 8 9]
S = sprintf('%i,',a);
S = S(1:end-1)