Guys I have problem to make a random matrix by considering some constraint and another matrix.
I have matrix :
A= [ 1 4 3 5 2 6 8 7 10 11 12 9;
4 1 2 3 6 5 9 8 7 10 11 12;
1 2 3 4 5 6 12 9 8 10 11 7]
then, i want to make a matrix B (3,12) which has value between 0 and 2 ([ 0 2]) randomly. but there is some constraint :
a. no consecutive zeros (0) more than 2.
b. sum all element in each row in matrix B <=11,
c. if there is value 1 or 2 or 3 or 4 in coordinate (a,b) in matrix A. so we have to force in coordinate(a,b+1) in matrix B have value zero (0).
thanks for your help before guys.