This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Unitize

Unitize[x]
gives when x is zero, and when x has any other numerical value.
  • Unitize gives for any x with magnitude less than dx.
  • Unitize[x] in general works using PossibleZeroQ, and can handle numbers represented in symbolic form.
Convert numerical values to zero or one:
Replace values in a matrix with zeros or ones:
Show a plot that emphasizes structure:
Convert numerical values to zero or one:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Replace values in a matrix with zeros or ones:
In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
Show a plot that emphasizes structure:
In[3]:=
Click for copyable input
Out[3]=
Determine if a sparse matrix is structurally symmetric:
New in 6