MATLAB: Overcome matrix maximum size problem

matrix

how could i possibly overcome the problem of being limited by matrix maximum size. i am thinking of maybe storing values to a file? is this possible?
suppose i have a code that lists a matrix of all binary possibilities from 0 to n, if n is too great the matrix would not be enough to store all values. what would be a good solution? also considering RAM limitations.

Best Answer

Accessing the harddisk is about 1000 times slower than RAM access. And if the calculation of the permutations of more than 52 symbols (from your last post) takes some years, writing this to the disk will exceed the life time of the computer in every case.
The solution is easy: Do not do this. There is simply no reason to calculate a giantic array which such a tiny density of information. It will be more efficient to create the single lines (or rows) dynamically. For permutations this can be done e.,g. by: