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!