MATLAB: Importdata – HELP MEMORY

importdata

I am trying to use importdata to import a .dat file which is approximately 349000KB in size. If I import about 75% of the data, MATLAB keeps his cool… but when I try to import the whole things he gets angry and tells me:
N=importdata('Respiratory_Modulation.dat',' ',1);
??? Error using ==> importdata at 214 Unable to load file. Use TEXTSCAN or FREAD for more complex formats.
Caused by: Error using ==> fileread at 36 Out of memory. Type HELP MEMORY for your options.
Why is he angry with me? What have I done?
Thanks,
Linford

Best Answer

Like mentioned in an other answer. A 64 Bit MATLAB on a 64 Bit machine should be tested.
There are however many smart methods to reduce memory. And very often the method depends on your data and application.
In this case, I assume, your data is of type DOUBLE and as you are more than halfway through importing, I like suggesting to convert the data into SINGLE. Most applications do not need DOUBLE data. But as I said, it depends what you do after the data is imported and how often you need to import new data sets.
Assuming, you like to try it:
  • Cut the data into half
  • import it
  • Convert it using SINGLE()
  • save it
  • Do it with the other half
  • Import both
Related Question