how to do this operation on a random matrix ?
Show older comments
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 ]
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!