csvreadで有効数字を増やすには?

Hi,
I try to read a csv file with 'csvread' command, however,
values with more than 5 digits are rounded into 5 digits.
For instance;
12345.1234 -> 1.2345e+4
I need to get 1.23451234e+4
How can I increase the effective digits for csvread commnad?
Thank you inadvance.

 Risposta accettata

madhan ravi
madhan ravi il 27 Dic 2018
Modificato: madhan ravi il 27 Dic 2018

0 voti

format long % at the beginning of your code
doc format % read it
doc dlmread
doc readtable

7 Commenti

madhan ravi
madhan ravi il 27 Dic 2018
Haruo Kodama's answer moved here for consistency:
Actually, I tryed 'format' and 'dlmread'.
Still, I can not increase digits more than 5.
Can I use 'precision' with dlmread?
What is wrong?
madhan ravi
madhan ravi il 27 Dic 2018
while writing the csv file use dlmwrite with precision option and then simply use dlmread to read the file
Haruo Kodama
Haruo Kodama il 27 Dic 2018
Thank you,
I will try it !
Haruo Kodama
Haruo Kodama il 27 Dic 2018
I tryed dlmread, but the reslts are the same.
1.2345e+4
What seems to be a promlem?
madhan ravi
madhan ravi il 27 Dic 2018
how do I know ? you didn‘t upload your code , you didn‘t upload your file ..
Haruo Kodama
Haruo Kodama il 27 Dic 2018
Yes ! It works !
Thank you for your support.
I just checked only works space table, and it showed only five digits,
but, once I exported data with dlmwrite + 'precision', I got right values!
It was my fault. Sorry!
Now, I found that dlmread and dlmwrite+precision are used
to increase the effective digits.
Thank you again.
madhan ravi
madhan ravi il 27 Dic 2018
Modificato: madhan ravi il 27 Dic 2018
Anytime :) , if my answer worked make sure to accept the answer.

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!