I am trying to use an integer variable as the first input argument to the UNIDRND function but receive an error. It is not stated anywhere in the documentation for UNIDRND that N must be of type double. When I execute the following command:
unidrnd(intmax, 1, 2)
I receive the following result:
??? Error using ==> times Integers can only be combined with integers of the same class, or scalar doubles. Error in ==> unidrnd at 28 r = ceil(n .* rand(sizeOut));
Best Answer