how to generate a random binary matrix with a specific condition?

조회 수: 1 (최근 30일)
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016년 5월 5일
댓글: Firas Al-Kharabsheh 2016년 5월 5일
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개)

Walter Roberson
Walter Roberson 2016년 5월 5일
  댓글 수: 1
Firas Al-Kharabsheh
Firas Al-Kharabsheh 2016년 5월 5일
I need a code to do this , i try to do this but the size of the a random matrix is bigger than G matrix

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by