lb=[56 65 21 21 16 7 31 32 35 32 17 40 79 114 104 69 56 41 16 16 11 9 10 19 35 36 19 29 34 14 19];
ub=[1171 1303 440 440 330 87 675 650 720 640 350 220 2200 2100 2100 1400 1139 837 405 220 240 269 220 730 710 400 600 661 150 105.5 330];
randomArray = lb + rand(1,31).*(ub-lb);
intArray=floor(randomArray);
Pgen=sum(intArray);
I am using this coding to produce a random array.The problem is the max of the sum intARRAY is 13000 .I try run the coding multiple time the sum can only reach to 13000.Why is this happening.I would to have the sum to produce a random array that the sum can reach 18000 to 21000 since the total sum of upper limit is 21000.
Best Answer