MATLAB: Generate random integer

random integer

Hi,
Can anyone help me to generate several strings of random integer ? In each string, there must be 5 integers generated which the number are in between 1 and 484. let say i wanna have 5 strings of the number. below is the example of the matrix that i need.
random number = [ 4 56 32 75 103; 47 84 302 400 27; 96 187 255 33 14; 387 293 135 34 73; 165 243 93 142 65 ]
Thanks in advanced.
nurul

Best Answer

ceil(484 * rand(5,5))
Note that this has the possibility of generating the same number multiple times. There are slightly different techniques if you require them to be unique along rows or columns.