I recently discovered, quite harshly, that Matlab's dlmread
and dlmwrite
don't store numerical values at double
accuracy. It effects my code, and I need to store big arrays with more precision.
A (not) working example :
pi1 = pi;
dlmwrite('pi',pi1);
pi2 = dlmread('pi');
pi1-pi2
ans =
-7.3464e-06
While I'd expect machine-error answer, of 10^-14 accuracy.
I'd much rather keep using a simple function as dlmwrite
, but I will consider other solutions.
Thanks