Skip to content

and

Element-wise logical AND (function form of &).

C = and(A, B)

Returns A & B applied elementwise. Non-zero values are treated as true. Use sc_eq-style short-circuit forms (registered as &&-equivalents) when only the truthiness of the result matters.

and([1 0 1], [1 1 0]) % [1 0 0]
  • or — Element-wise logical OR (function form of |).
  • xor — Element-wise logical XOR (exclusive or).
  • unot — Unary logical NOT (function form of ~).
  • sc_eq — Short-circuit equality (scalar context).