I could not generate a notebook with 10000 30 x15 matrices without the Mathematica front-end eating up a good deal more then 2 GB of memory. Best I have done so far is create and save a notebook file with 2500 such matrices. On my system, this used up about 800 MB of Mathematica front-end memory. The good news is that it was done with one line of code:
CreateDocument @ Table[Style[RandomReal[1., {30, 15}] // MatrixForm, Blue], {2500}];
After saving the newly generated matrix notebook, I quit Mathematica, and then restarted it again by double-clicking on the matrix notebook's icon. The matrix notebook loaded quickly and only used about 4 MB of front-end memory. Using the File > Print... menu items, I was able to create a PDF file with two matrices per page (trying to put more on a page made the numbers too small for comfortable reading).
You asked in chat, how this approach could be modified to handle the case where each matrix generated has a dependency on an iteration variable n
. Suppose this dependency was scalar multiplication by n
. In this case, n
would simply be the first element in the in the iteration control list, the second argument of Table
:
CreateDocument @ Table[Style[n RandomReal[1., {30, 15}] // MatrixForm, Blue], {n, 2500}];
Should you adopt this approach, I recommend doing it with a freshly launched front-end session.
RandomReal
can produce matrices, so your example can be reduced toDo[Print[Style[RandomReal[1., {30, 15}] // MatrixForm, Blue]], {10000}]
. $\endgroup$