The randomtensor command generates an l by m by n tensor of a random integers x with 0 <= x < z. If a fifth argument p is given, it is the probability that an integer is generated.
randomtensor(1,2,3,10); [[[2, 5, 9], [6, 4, 1]]]