how to generate a random binary matrix with a specific condition?
1 次查看(过去 30 天)
显示 更早的评论
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 ]
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!