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
- Unbelievable invention of Bheema's skeleton or Bhima's son Gadotkach like skeleton found: A hoax mail
- Online status of permesso di soggiorno on the website of Polizia di Stato
- SBI transaction on 30-Nov-0019 for INTERNET BANKING, what is this for?
- Matlab boxplot: how to change the line width (LineWidth) and color of the lines?
- Convert Longitude 0-360 to -180 to 180 or 180W-180E in fortran and matlab, transform lat lon coordinates
No comments:
Post a Comment