You want to create a huge matrix. It is not sparse, else you would have said that most of the elements are zeros. Sparse won't help you otherwise, and for there to be any gain at all, you want only a small percentage of the values to be non-zero.
How big is the matrix? This is a computation you should do yourself!
So roughly 18 billion elements. If they are doubles, then each element uses 8 bytes. Therefore that matrix will require roughly 144 gigabytes of memory. How can you be surprised if you ran out of memory?
Even for a uint8 array, it will still require 18 gigabytes of RAM. You have 6 GB, of which MATLAB will use only a fraction of that for array storage.
You don't say which version of MATLAB you are using. Is this a 64 bit version?
People think their computers are infinitely large and infinitely fast. Computers have a finite amount of RAM. Sorry, but they do. If you want to work with huge arrays, then get more memory. Use the 64 bit version of MATLAB for your computer, so it can address all that memory. Note that even if you have 64 bit MATLAB, trying to work with that huge of an array will be incredibly slow UNLESS you have sufficient RAM. Big problems require big computers.