It looks like I can get the right effect using component-wise
multiplication:

julia> ![true, true, false] .* [false, true, true]
3-element Array{Bool,1}:
 false
 false
  true


Is this the correct solution or is this an ugly hack?

Cheers,
Daniel.



On 21 September 2015 at 14:35, Daniel Carrera <[email protected]> wrote:

> Hello,
>
> I have two boolean arrays and I am trying to obtain the boolean array
> resulting from a component-wise `AND`:
>
> julia> [true, true, false] .&& [false, true, true]
> ERROR: syntax: invalid identifier name "&&"
>
> julia> [true, true, false] .& [false, true, true]
> ERROR: type Array has no field &
>
>
> Can anyone figure out what I'm doing wrong? I was hoping that `.&` and
> `.&&` would apply the operation on a per-component basis. Help?
>
> Cheers,
> Daniel.
>

Reply via email to