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.

 채택된 답변

madhan ravi
madhan ravi 2018년 12월 27일
편집: madhan ravi 2018년 12월 27일

0 개 추천

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

댓글 수: 7

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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

릴리스

R2018b

질문:

2018년 12월 27일

편집:

2018년 12월 27일

Community Treasure Hunt

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

Start Hunting!