[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: elementwise boolean operations
From: |
Judd Storrs |
Subject: |
Re: elementwise boolean operations |
Date: |
Thu, 20 May 2010 13:49:14 -0400 |
On Thu, May 20, 2010 at 1:35 PM, mmasny <address@hidden> wrote:
>
> I have bool matrices. How do I perform elementwise &&, || and so on? I use
> normal algebraic operators along with the rem function, but I guess it's not
> the best way?
IIRC && and || do short circuiting and are better suited for
non-matrix values for conditional expressions (if, do, while).
I think & and | will do what you want. There are functional forms too:
and(), or(), xor(), etc. The functional forms can take multiple
inputs.
--judd