Generate 3D depth-first mazes in Matlab