how to do this operation on a random matrix ?
Afficher commentaires plus anciens
if i have this matrix (n,m)
M = [ 1 0 1 1 0 0 1
1 1 0 1 0 1 0
0 1 1 0 1 1 0
1 1 1 0 0 0 0
1 1 0 0 0 0 0 ]
i want a function to generate a binary random matrix (n,m) depend on how many number of ones in each row in M is equal to number of ones in the same row in X
one solution is
X = [ 1 0 1 1 0 0 1
1 1 0 1 0 1 0
0 1 1 0 0 1 1
0 1 1 1 0 0 0
0 0 0 1 1 0 0]
another solution for the random matrix will be
x = [ 0 1 0 1 1 0 1
0 1 1 0 1 0 1
1 1 0 0 0 1 1
0 0 0 0 1 1 1
0 1 1 0 0 0 0 ]
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!