MATLAB: Avoid rounding off the decimal values,while loading the data from textfile

data import

Hi,
I am trying to load a certain text file,which contains 2 columns of data. I have written this:
R = load('data.txt');
Upon loading the data, I observed that, data in the columns has been rounded off to first 4 digits only. How can we get the complete data (for example, if the data has decimals upto 6 digits).

Best Answer

I observed that, data in the columns has been rounded off to first 4 digits only
How did you observed that?
Note that the way matlab displays a number (which can be easily adjusted with format) and the way matlab stores the values in memory are two very different things:
>>format shortg
>>a = 1.23456789
a =
1.2346
a appears to only store 4 decimals, however
>>a-1.2346
ans =
6.789e-5
clearly it still had all the decimals
>>format longg
>>a
a =
1.23456789
Yep, still there.