find inverse of a non square binary matrix in matlab

Hi,
I have used a couple of functions to find the inverse of a non-square boolean matrix in matlab. Here is a list of them : using :
inverse_g=mod(floor(mrdivide(I,A)),2);
inverse_g=I\A;
pinv(double(A));
I have tried to verify if the matrix obtained satisfies the property A*inv(A)=inv(A)*A=I
I have found that none of the properties are satisfied. I am not sure because this is a non square matrix if this property still holds good. Since I am using this inverse for processing later on I am sure that the obtained inverse is not correct. Can someone point me to the right direction ?
Thanks, Bhavya

2 Comments

Can you give us the context - the larger picture? Usually when someone says inverse regarding a binary (logical, boolean) matrix, then mean this invertedMatrix = ~logicalMatrix. I don't think you can take the matrix inverse of a non-square matrix, like you are trying to do. That's why I want to know why you think you want to do that.
I am actually trying to solve the equation Ax=b. In my case both A and b are boolean/logical matrices. I have tried to solve this equation using the
solution=mod(floor(mrdivide(b,A)),2);
But I check this solution it does not seem to match with the values I started with

Sign in to comment.

Answers (1)

2 Comments

Hi,
Thanks for pointing this out to me, this would essentially mean that I would need to use the algorithm implementations to check if a GF(2)matrix is invertible and ten try to invert it in the usual way?
No, you cannot use the "usual way" to invert it, not if what you want to get out is a boolean matrix. The steps are similar, but you need to interpret '+' as XOR and you need to interpret '*' as AND .

Sign in to comment.

Categories

Asked:

on 4 Feb 2012

Edited:

on 30 Sep 2013

Community Treasure Hunt

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

Start Hunting!