MATLAB: Create Random number and controll generated number

random number generator

hi all i want create random number between 0 to 7 and put then on array with for index i use
genValue=randi([0 4],1,1); %for first index
genValue=randi([minRnd 5],1,1); %for second index
genValue=randi([minRnd 6],1,1); %for Third index

genValue=randi([minRnd 7],1,1); %for Third index
minRnd is value of previous value of current index added to 1; but must time randi function generate and return the larger number than small number for example genValue=randi([3 7],1,1); return 6 or 7 must times than 5,4,3

Best Answer

Use randsample() with a vector of weights if you have the Statistics toolbox