in reply to Out of Memory when generating large matrix
If your matrix contains many zeros, you may wish to consider a Sparse Matrix.