tags:

views:

62

answers:

2

hello. i want to calculate 2 covariance matrix with size (10304,1034) and matlab create the first one but when it run the second command error occurs

>> j=ones(10000,10000);
>> jj=ones(10000,10000);
??? Out of memory. Type HELP MEMORY for your options.

my laptop ram is 2GB but it still have 1 GB free i use win seven and matlab 2009b 32 bit plz help

+3  A: 

A 10k-by-10k array of doubles uses 1e8*8 bytes, which corresponds to 800MB. MATLAB needs these 800MB to be contiguous. Most likely, your 1GB free memory is a little fragmented, so MATLAB cannot fit the new array into RAM.

Use the command MEMORY to find out the maximum variable size that MATLAB can handle at a given moment.

Jonas
By the way, the memory is not available as a call on all platforms. I think it is only found on PC installations.
woodchips
Indeed. But the OP is running Windows 7, so for them it should work.
Jonas
A: 

Try to use sparse matrices, in that case MATLAB doesn't allocate the entire space.

matteodefelice

related questions