[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: operations on binary matrices
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: operations on binary matrices |
Date: |
Thu, 24 Nov 2011 18:17:43 -0500 |
On 24 November 2011 17:51, mmasny <address@hidden> wrote:
> I would like to write two programs. The first one is supposed to
> multiply two square binary matrices. I want to multiply them in a
> way simlilar to the way we multiply matrices usually, except I take
> the sum of elements to be the logical disjunction and the product to
> be the logical conjunction.
How about
mod (A*B, 2)
?
> The second program is supposed to compare matrices in terms of the
> following partial order: A<=B iff (A(i,j)==1 implies B(i,j)==1).
Try
all ((A <= B)(:))
HTH,
- Jordi G. H.