3
votes

I have a file containing a very very huge matrix, size in millions x hundreds, and I wanna further process this matrix on and at the same time, conserve memory. But unfortunately, dlmread returns a double type matrix.

The numbers on this file are 0-255 only, so uint8 is the most suitable. But I have hit my memory limit, and Matlab starts yelling out "Out of memory" error, when I tried to convert the loaded matrix into uint8, with myMat = single(myMat); It makes sense, because a new matrix has to be created before removing the old one.

Can I do anything with this?

1

1 Answers

4
votes

You could convert your data file to a suitable (i.e. lossless) 8 bit image format (using an external program) and then read it into MATLAB with imread. Reading this file should be a lot quicker too, as there is no data conversion involved.