How to form a matrix such that every time the numbers add up to be the same
z=0.4minimum z= 0.2maximum z= 0.6R is a random number between 0.2 and 0.6a 1x10 R matrix is generated but the sum must be equal to (0.4 x 10 = 4)
I tried running the following using randn but it gives negatives numbers and the sums are not constant
z=0.4zmax=1.5*z;zmin=0.5*z;R=zmin+randn(1,10)*(zmax-zmin);Eg. Desired random number R matrix[0.35 0.27 0.43 0.51 0.54 0.44 0.37 0.29 0.59 0.21]sum(R)=4 < must be consistent for every matrix generated
Best Answer