jacky
jacky

Reputation: 81

How to a avoid MATLAB round values when I save them as csv file?

I used csvwrite function. The original input vector's elements increase by 0.001: 0 , 001, 002....but when I save it as csv file the excel shows values like this at bigger numbers: 99.999, 100, 100, 100, etc. Changing the data format in excel doesn't solve the problem. Any suggestions?

Upvotes: 0

Views: 304

Answers (1)

ylpjört
ylpjört

Reputation: 138

According to its help page, csvwrite has the following limitations:

csvwrite writes a maximum of five significant digits. If you need greater precision, use dlmwrite with a precision argument.

However, both functions are no longer recommended by MathWorks, but the use of writetable, writematrix, or writecell is encouraged instead.

Upvotes: 1

Related Questions