Re: Export data to CSV and Format of numbers



Learner <cnfengshuang@xxxxxxxxx> wrote in message <4374cd39-
d419-481d-a3b9-b770c620f6c9@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:487929

Hi ,

I want to export a matrix to csv, but found the format of
the numbers
are all "short" in the CSV file. I used "format long" in
my codes, and
the number format of data is correct when I open it in
Matlab.

How can I get the exported data in the right format?

Thank you!

Learner

Use dlmwrite which allows you to specify the precision.
csvwrite calls dlmwrite.

Donn

.



Relevant Pages

  • Re: changing text color
    ... ; undefined variable: princ ... ((equalp "Green" color) ... mixed in with the format statement and no arguments are ... supplied for the control codes. ...
    (comp.lang.lisp)
  • Re: Matlab Data Analysis
    ... I have been given the program with no documentation and have been ... Matlab, I am not too sure how to extract data from the program and to ... In what format should the data be exported from MATLAB? ... What types of graphs do you want to plot? ...
    (comp.soft-sys.matlab)
  • Re: Switches/field codes to fix zip code in merge
    ... It doesn't work in all cases (e.g. if you do not actually have Excel ... If you enter 5-digit ZIPs by entering the 5 digits, ... have ZIP codes with leading zeroes, you can ensure that you always ... see all 5 digits by applying the ZIP format, ...
    (microsoft.public.word.mailmerge.fields)
  • Re: Switches/field codes to fix zip code in merge
    ... switching to the DDE approach that Graham has mentioned will sort out a lot of problems using Excel data sources. ... If you enter 5-digit ZIPs by entering the 5 digits, Excel will save the data as a number with "General" formatting and display the number, right justified, with no leading zeroes. ... If it is possible to have ZIP codes with leading zeroes, you can ensure that you always see all 5 digits by applying the ZIP format, which is a numeric format: ...
    (microsoft.public.word.mailmerge.fields)
  • Re: "MR2"
    ... Those codes are processor codes / conversions. ... A format mask as ... historically Pick has allowed numeric conversion codes w/ or w/o format ... guessing that's the result of a failed date conversion. ...
    (comp.databases.pick)