matrix of (zeros) and (ones)

1 view (last 30 days)
Behnam
Behnam on 24 Sep 2014
Commented: Sean de Wolski on 24 Sep 2014
Hi everyone! I would like to make a matrix of zeros and ones named [B] as:
A=[ qxp ] and B=[ mxn ]
n=p
m=p^q x q
where matrix [A] is known and matrix [B] has to be obtained. Actually, matrix [B] is built by the combination of either (0) or (1) as the sum of each row has to be equal to one. It means at each row two (zeros) or two (ones) cannot be placed.
| A(11) A(12) |
A = | |
| A(21) A(22) |
Hint: The point is, matrix [B] consists of 4 matrices of [2x2] which means for each block of [2x2] at each row the combination of 0 and 1 is made. Matrix [B] is made in order to consider the possible combination of matrix [A] when it multiplies to it. That is for first array of matrix [A]; A(11) has the possibility to be summed by either A(21) which is block B(1) or A(22) which is block B(2).
For example for a 1st and 2nd block of matrices of [2x2]:
| 1 0 | | 1 0 |
B(1)=| | and B(2)=| |
| 1 0 | | 0 1 |
The total matrix [B] would be a matrix of [8x2] as:
--- ---
| 1 0 |
| 1 0 |
| 1 0 |
B= | 0 1 |
| 0 1 |
| 1 0 |
| 0 1 |
| 0 1 |
--- ---
Can anyone help me please?
  1 Comment
Sean de Wolski
Sean de Wolski on 24 Sep 2014
What have you done so far for your homework problem?

Sign in to comment.

Answers (0)

Categories

Find more on Loops and Conditional Statements 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!