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.

 Respuesta aceptada

madhan ravi
madhan ravi el 27 de Dic. de 2018
Editada: madhan ravi el 27 de Dic. de 2018

0 votos

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

7 comentarios

madhan ravi
madhan ravi el 27 de Dic. de 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 el 27 de Dic. de 2018
while writing the csv file use dlmwrite with precision option and then simply use dlmread to read the file
Haruo Kodama
Haruo Kodama el 27 de Dic. de 2018
Thank you,
I will try it !
Haruo Kodama
Haruo Kodama el 27 de Dic. de 2018
I tryed dlmread, but the reslts are the same.
1.2345e+4
What seems to be a promlem?
madhan ravi
madhan ravi el 27 de Dic. de 2018
how do I know ? you didn‘t upload your code , you didn‘t upload your file ..
Haruo Kodama
Haruo Kodama el 27 de Dic. de 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 el 27 de Dic. de 2018
Editada: madhan ravi el 27 de Dic. de 2018
Anytime :) , if my answer worked make sure to accept the answer.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2018b

Etiquetas

Preguntada:

el 27 de Dic. de 2018

Editada:

el 27 de Dic. de 2018

Community Treasure Hunt

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

Start Hunting!