Thread Subject: matrix operations in F2

Subject: matrix operations in F2

From: Joren Heit

Date: 7 Nov, 2009 12:13:02

Message: 1 of 5

Hi,

I want to solve an equation of the form Ax=b, where A is an nxn square matrix, and x and b are nx1 column vectors. Ofcourse, this can normally be done using x=b/A. However, the matrices for A that I have are singular, therefore there is no solution. In my case, there are solutions because I'm working in F2. This means that there are only ones and zeros to be concerned, and 1+1=0, 0-1=1. This way, the equation can be solved. Is there a way in MATLAB to take this into account and let MATLAB solve anyway?

Joren

Subject: matrix operations in F2

From: ade77

Date: 7 Nov, 2009 14:05:18

Message: 2 of 5


> I want to solve an equation of the form Ax=b, where A is an nxn square matrix, and x and b are nx1 column vectors. Ofcourse, this can normally be done using x=b/A. However, the matrices for A that I have are singular, therefore there is no solution. In my case, there are solutions because I'm working in F2. This means that there are only ones and zeros to be concerned, and 1+1=0, 0-1=1. This way, the equation can be solved. Is there a way in MATLAB to take this into account and let MATLAB solve anyway?
>
> Joren

type doc pinv or help pinv

Subject: matrix operations in F2

From: Joren Heit

Date: 7 Nov, 2009 15:12:00

Message: 3 of 5

Not what I meant...
I need to solve a set of equations like

| 1 1 0 0 | | x1 | | 1 |
| 1 1 1 0 | | x2 | = | 1 |
| 0 1 1 1 | | x3 | | 1 |
| 0 0 1 1 | | x4 | | 1 |

Under the conditions that 0-1=0 and 1+1=0, this results in
x = (1 0 0 1)

Now I need to do this for very large matrices....

"ade77 " <ade100a@gmail.com> wrote in message <hd3uqu$ru1$1@fred.mathworks.com>...
>
> > I want to solve an equation of the form Ax=b, where A is an nxn square matrix, and x and b are nx1 column vectors. Ofcourse, this can normally be done using x=b/A. However, the matrices for A that I have are singular, therefore there is no solution. In my case, there are solutions because I'm working in F2. This means that there are only ones and zeros to be concerned, and 1+1=0, 0-1=1. This way, the equation can be solved. Is there a way in MATLAB to take this into account and let MATLAB solve anyway?
> >
> > Joren
>
> type doc pinv or help pinv

Subject: matrix operations in F2

From: Bruno Luong

Date: 7 Nov, 2009 18:57:01

Message: 4 of 5

"Joren Heit" <jorenheit@gmail.com> wrote in message <hd42o0$re0$1@fred.mathworks.com>...
> Not what I meant...
> I need to solve a set of equations like
>
> | 1 1 0 0 | | x1 | | 1 |
> | 1 1 1 0 | | x2 | = | 1 |
> | 0 1 1 1 | | x3 | | 1 |
> | 0 0 1 1 | | x4 | | 1 |
>
> Under the conditions that 0-1=0 and 1+1=0, this results in
> x = (1 0 0 1)
>
> Now I need to do this for very large matrices....
>

I guess you have to write your own Gaussian pivoting, unless if there is such thing already on FEX.

This has been discussed here:
http://www.mathworks.com/matlabcentral/newsreader/view_thread/261760#684562

Bruno

Subject: matrix operations in F2

From: Steven Lord

Date: 8 Nov, 2009 23:41:36

Message: 5 of 5


"Joren Heit" <jorenheit@gmail.com> wrote in message
news:hd3o8e$h25$1@fred.mathworks.com...
> Hi,
>
> I want to solve an equation of the form Ax=b, where A is an nxn square
> matrix, and x and b are nx1 column vectors. Ofcourse, this can normally be
> done using x=b/A. However, the matrices for A that I have are singular,
> therefore there is no solution. In my case, there are solutions because
> I'm working in F2. This means that there are only ones and zeros to be
> concerned, and 1+1=0, 0-1=1. This way, the equation can be solved. Is
> there a way in MATLAB to take this into account and let MATLAB solve
> anyway?

Since you're working in GF(2), the GF object from Communications Toolbox,
may do what you want.

http://www.mathworks.com/products/communications/demos.html?file=/products/demos/shipping/comm/gfdemo.html

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com