MATLAB: How to randomly plot 32 cubes on a 3D rectangle that is 4Wx8Lx10H

plotting on a 3d rectanglerandomrandom plotting

I have a 3D rectangular space that is 4 feet wide x 8 fee long x 10 feet high = 320 cubic feet. I need to randomly plot 32 (1foot) cubes inside this 3D rectangle. Constraints are: No more than 1 (one) cube along the height dimension. Said another way – The 3D rectangle will be suspended from the ceiling of a room 4 feet wide, 8 feet long, and hang down 10 feet from the ceiling. The cubes need to be evenly spaced across the 4 foot by 8 foot axis, and no cube can hang directly below another cube along the 10 foot height axis.
Related Question