I am trying to store a matrix of size 4 x 10^6
, but the Matlab can't do it when running it, it's like it can't store a matrix with that size or I should use another way to store. The code is as below:
matrix = [];
for j = 1 : 10^6
x = randn(4,1);
matrix = [matrix x];
end
The problem it still running for long time and can't finish it, however when I remove the line matrix = [matrix x];
, it finishes the loop very quickly. So what I need is to have the matrix
in file so that I can use it wherever I need.