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.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Give 1 if the first arguments are equal:

In[1]:=
Click for copyable input
Out[1]=

Give 0 if they are not equal:

In[2]:=
Click for copyable input
Out[2]=

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

In[3]:=
Click for copyable input
Out[3]=
Introduced in 2008
(7.0)