how to generate a random binary matrix with a specific condition in matlab?
问题 If matrix A shows the number of group of ones in G (n,m) matrix like that G = [ 1 1 0 0 1 0 1 1 1 0 1 0 1 1 1 ] so the A matrix will be A = [ 2 1 3 0 1 3 ] Then i want to generate (n,m) random matrix which the ones in this Matrix depend on A in the same order they appear one solution will be x = [ 0 1 1 0 1 0 0 1 1 1 1 0 1 1 1 ] another solution x = [ 1 1 0 1 0 1 1 1 0 0 1 0 1 1 1 ] 回答1: As mentions in comments to the OP, StackOverflow is not a code-writing service. Having said that, this was