create random number generator 23x34 in matlab

In MATLAB, you can use the randi function to generate a matrix of random integers of a specified size. To create a random number generator of size 23 by 34, you can use the following code:

main.m
rng('default') % set the random number generator's seed to the default value
randi([0, 9], 23, 34) % generate a 23-by-34 matrix of random integers between 0 and 9
163 chars
3 lines

The rng('default') function is optional, but it sets the random number generator's seed to the default value, which ensures that the random numbers generated are always the same. If you omit this line, you will get different random numbers each time you run the script.

gistlibby LogSnag