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
- Chanakya TV serial, online on youtube, Vol 1-8, All episodes 1-47
- How to invite wife or spouse to Italy
- Online status of permesso di soggiorno on the website of Polizia di Stato
- Unbelievable invention of Bheema's skeleton or Bhima's son Gadotkach like skeleton found: A hoax mail
- How to become Official VoIP reseller of betamax and dellmont services
No comments:
Post a Comment