Friday, November 3, 2017
Convert a vector or array of numbers into a comma separated CSV string
Lets say A is vector or numbers or integers and you want to add a separator "," or ".,"
A=[1:10]
for j=1:length(A);
%Here ".," is the separator, you can use other separator also
C{j}=sprintf('%s.,',num2str(A(j)));
end;
cell2mat(C)
Output
1.,2.,3.,4.,5.,6.,7.,8.,9.,10
If you want comma only then you can use "," as a separator in sprintf
Posted by
vicky
at
12:15 AM
Subscribe to:
Post Comments (Atom)
Popular
- New Rules to add spouse name in the Indian passport
- Chanakya TV serial, online on youtube, Vol 1-8, All episodes 1-47
- Spouse visa, wife visa or family visa, Bring your spouse together with you while coming to Italy
- Jawahar Navodaya Vidyalaya Rajsamand, My feelings and emotions for JNVR
- Tabrio Hack to multiply your credits by registering same phone number
No comments:
Post a Comment