MATLAB: Possible combinatios of integers 0-9 in triads

combinationsintegers

For some calculations I have the variables nx, ny, nz. Those variables can take the values of the integers 0-9 and I need all the possible [nx, ny, nz] combinations, for example (0, 0, 1), (0,1,0), (9,9,9) etc. How can I do this in Matlab ? Thank you in advance

Best Answer

xyz = dec2base(0:999,10) - '0';