A = [8 1 5; 1 4 2; 7 5 2];
Max = 5
B = randi(Max);
Right now I have a part of the code which generates a random number. I am looking to generate a random number from a list of numbers, in this case the numbers listed in the first row (8 1 5).
Instead of using randi is there another function that will generate randomly one of the numbers listed in first row and also meet the Max criteria?
From what you specified, I suggest the following:
Hope this gives some ideas,