I have a problem with matlab when I'm trying to create a a matrix with a very large size such as 40000x40000.
for example:
x=zeros(40000,40000);
the error message is "??? Maximum variable size allowed by the program is exceeded. "
is there any solution.
Also I have another question, can we have a matrix with variable column size such as in java.
40000 * 40000 * 8 bytes per number = 12 GB, surely you won't have enough memory.
To create a huge matrix with lots of zeros, you need a sparse matrix:
m = sparse(40000, 40000)
To create an array of variants, you can use a cell array:
m = cell(3, 1)
m(1) = [1,2,3]
m(2) = [2,4,6,8,10]
m(3) = 6+6i
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With