WLJS LogoWLJS Notebook

DiscreteIndicator

DiscreteIndicator[x, x1, {u1, u2, ...}] yields the discrete indicator function, equal to 1 if x=x1 and, otherwise, to 0 if x=ui for some i.

Examples

DiscreteIndicator[a, a, {a, b, c}]
(* 1 *)
DiscreteIndicator[b, a, {a, b, c}]
(* 0 *)

Please visit the official Wolfram Language Reference for more details.

On this page