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.

Details

Examples

open allclose all

Basic Examples  (1)

Give 1 if the first arguments are equal:

Give 0 if they are not equal:

If the first argument does not appear in the third argument, return unevaluated:

Applications  (1)

Represent nominal terms in fitting results:

See the functional form:

Evaluate the FittedModel at points a and b:

Properties & Relations  (2)

DiscreteIndicator is equivalent to Boole when both values are in the set:

They differ if either of the first two values is not in the set:

Products of indicator functions effectively correspond to an outer product:

Introduced in 2008
 (7.0)