Use Gaussian Jordan Elimination to convert binary matrix to All zero Matrix
Show older comments
Hello,
Consider I have my binary matrix. I want to use Gauss Jordan Elimination to convert a part of my matrix to all zero. Below is an illustrative example of what I seek
% ***** All '+' correspond to XOR operations where 0+0=0; 1+0=1; 0+1=1; 1+1=0; ***** %
a b c d | e f | g h i j k l
--------|-----|------------|
1 1 0 0 | 0 1 | 1 0 1 0 1 0| R1
0 1 1 1 | 0 1 | 0 1 0 0 1 0| R2
0 0 1 1 | 1 0 | 1 0 1 1 0 0| R3
0 0 0 1 | 0 1 | 1 1 0 1 0 1| R4
--------|-----|------------|
1 1 0 0 | 1 0 | 0 1 1 0 0 1| R5
1 0 1 0 | 1 0 | 0 0 0 1 1 1| R6
%\______/
||
\/
%Assume I
%want to
%convert
%this to
%all zero
R5 = R1+R5
1 1 0 0 0 1 1 0 1 0 1 0
+ 1 1 0 0 1 0 0 1 1 0 0 1
------------------------
R5 = 0 0 0 0 1 1 1 1 0 0 1 1
------------------------
Now we work for Row 6.
Ans = R1+R6
1 1 0 0 0 1 1 0 1 0 1 0
+ 1 0 1 0 1 0 0 0 0 1 1 1
-----------------------
Ans = 0 1 1 0 1 1 1 0 1 1 0 1
-----------------------
Ans1 = R2+ans
0 1 1 1 0 1 0 1 0 0 1 0
+ 0 1 1 0 1 1 1 0 1 1 0 1
-----------------------
Ans1 = 0 0 0 1 1 0 1 1 1 1 1 1
-----------------------
Ans2 = R4+Ans1
0 0 0 1 0 1 1 1 0 1 0 1
+ 0 0 0 1 1 0 1 1 1 1 1 1
-----------------------
Ans2 = 0 0 0 0 1 1 0 0 1 0 1 0
-----------------------
Final Matrix Becomes
a b c d | e f | g h i j k l
--------|-----|------------|
1 1 0 0 | 0 1 | 1 0 1 0 1 0| R1
0 1 1 1 | 0 1 | 0 1 0 0 1 0| R2
0 0 1 1 | 1 0 | 1 0 1 1 0 0| R3
0 0 0 1 | 0 1 | 1 1 0 1 0 1| R4
--------|-----|------------|
0 0 0 0 | 1 1 | 1 1 0 0 1 1| R5
0 0 0 0 | 1 1 | 0 0 1 0 1 0| R6
%\______/
||
\/
%Converted
%into an all
%zero matrix
By hand it is probably an elementary easy operation. But it does get out of hand when I want to automate this process. It gets out of hand when I want to create a generalised code that can work on any (mxn) matrix. Don't even imagine how to do this on a 93x155 matrix(That is what I am working on).
One good thing about this is that the matrix above the part I want to convert to all zero will always be a 'LOWER TRIANGULAR MATRIX'. So getting an answer IS possible.
But how, thats the question. If anyone of you scholars, Professionals can help me out on this one, It'll be great. Thanks in advance.
3 Comments
James Tursa
on 26 Jan 2021
Did you mean "UPPER TRIANGULAR MATRIX", as in what your example shows? If so, then why not just code up your scheme?
Rishi Balasubramanian
on 27 Jan 2021
Walter Roberson
on 27 Jan 2021
Duplicated by https://www.mathworks.com/matlabcentral/answers/727403-gaussian-jordan-elimination-of-matrix?s_tid=srchtitle (now closed)
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping 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!