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

1 visualizzazione (ultimi 30 giorni)
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 ]

Risposte (1)

Walter Roberson
Walter Roberson il 5 Mag 2016
  1 Commento
Firas Al-Kharabsheh
Firas Al-Kharabsheh il 5 Mag 2016
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

Accedi per commentare.

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by