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
- SBI transaction on 30-Nov-0019 for INTERNET BANKING, what is this for?
- Convert Longitude 0-360 to -180 to 180 or 180W-180E in fortran and matlab, transform lat lon coordinates
- Quickly plot a shapefile in Matlab
- Online status of permesso di soggiorno on the website of Polizia di Stato
- New Rules to add spouse name in the Indian passport
No comments:
Post a Comment