If each element of the 3D matrix takes one value of 4 discrete values. How can I obtain all possible combinations of this 3D matrix?
3 views (last 30 days)
Walter Roberson on 7 May 2017
With 4 possible values for each entry, the number of different possibilities would be 4^10 * 4^10 * 4^2, which would be 17592186044416 matrices, which is 2^44 matrices. Each matrix would require 10*10*2 = 200 doubles, and each double would require 8 bytes. The total storage requirements would exceed 2^54 bytes.
Unfortunately for you, no released version of the x64 architecture implements more than 48 address pins. You therefore cannot find any MATLAB system anywhere in the world that is able to access enough memory to construct that table.
This hints that you are working on an optimization problem in which you have been thinking that the best way to proceed is to try every possible combination and select the best. You do not have enough memory or time to do that, no matter how well it works "mathematically". You will need to find a different approach.
For example, you can use https://www.mathworks.com/help/gads/mixed-integer-optimization.html ga with integer constraints. The constraints you would use would be that each entry would be 1 to 4. Then, inside your objective function, instead of directly using the x value, you would use the x value to index into your vector to determine the numeric value to use.