MATLAB: I want to create a [315,000 x 315,000] matrix.

matrixmaximum matrix size

I want to create a [315,000 x 315,000] matrix. what can I do i to solve this problem and create the desired matrix size?
Hint: my computer has a i5 processor and 4GB RAM, and I'm working on WIN10 pro.

Best Answer

If the matrix is sparse and logical or double precision then you need to create it with one of the sparse creation routines such as sparse(). The size of matrix you would be able to fit would depend upon how densely populated the sparse matrix was.
If the matrix is not sparse but is logical or uint8 or int8 then you need about 950 megabytes per copy of the matrix.
If the matrix is not sparse but is uint16 or int16 then you need about 1.9 gigabytes per copy of the matrix.
If the matrix is not sparse but is uint32 or int32 or single precision, then you need about 3.7 gigabytes per copy of the matrix.
If the matrix is not sparse and is double precision then you need about 7.4 gigabytes per copy of the matrix.
If you do not presently have enough memory, then you will need to add more RAM or add virtual memory (such as swapping to disk.) Swapping to disk can about 100 times or more slower than if you had enough RAM.
Related Question