Re: Export data to CSV and Format of numbers
- From: "Tim Farajian" <timfarajian_REMOVEME@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 31 Aug 2008 00:39:01 +0000 (UTC)
Learner <cnfengshuang@xxxxxxxxx> wrote in message <4374cd39-
d419-481d-a3b9-b770c620f6c9@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
,gzip(gfe),gzip(gfe)the numbers
Xref: news.mathworks.com comp.soft-sys.matlab:487929
Hi ,
I want to export a matrix to csv, but found the format of
are all "short" in the CSV file. I used "format long" inmy codes, and
the number format of data is correct when I open it inMatlab.
How can I get the exported data in the right format?
Thank you!
Learner
The "format long" command only affects how numbers are
displayed on the screen. It doesn't affect how numbers are
written into files.
If you want to write data into a CSV file with a specified
precision, use the DLMWRITE function. Specify the
delimiter to be ',' and specify the precision to what you
want. For example:
A = rand(3,3);
dlmwrite('test.csv',A,...
'delimiter',',','precision','%0.16f')
For more info type
doc dlmwrite
.
- References:
- Export data to CSV and Format of numbers
- From: Learner
- Export data to CSV and Format of numbers
- Prev by Date: Re: how to rotate region in segmented image
- Next by Date: Re: Matlab doesn't start (only start screens shows)
- Previous by thread: Re: Export data to CSV and Format of numbers
- Next by thread: Re: Simulink Model compare
- Index(es):
Relevant Pages
|