WOLFRAM

Unitize[x]

gives 0 when x is zero, and 1 when x has any other numerical value.

Details

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Convert numerical values to zero or one:

Out[1]=1
Out[2]=2

Replace values in a matrix with zeros or ones:

Out[2]=2

Show a plot that emphasizes structure:

Out[3]=3

Applications  (1)Sample problems that can be solved with this function

Determine if a sparse matrix is structurally symmetric:

Out[1]=1
Out[2]=2
Wolfram Research (2007), Unitize, Wolfram Language function, https://reference.wolfram.com/language/ref/Unitize.html.
Wolfram Research (2007), Unitize, Wolfram Language function, https://reference.wolfram.com/language/ref/Unitize.html.

Text

Wolfram Research (2007), Unitize, Wolfram Language function, https://reference.wolfram.com/language/ref/Unitize.html.

Wolfram Research (2007), Unitize, Wolfram Language function, https://reference.wolfram.com/language/ref/Unitize.html.

CMS

Wolfram Language. 2007. "Unitize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Unitize.html.

Wolfram Language. 2007. "Unitize." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Unitize.html.

APA

Wolfram Language. (2007). Unitize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Unitize.html

Wolfram Language. (2007). Unitize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Unitize.html

BibTeX

@misc{reference.wolfram_2025_unitize, author="Wolfram Research", title="{Unitize}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Unitize.html}", note=[Accessed: 04-June-2025 ]}

@misc{reference.wolfram_2025_unitize, author="Wolfram Research", title="{Unitize}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/Unitize.html}", note=[Accessed: 04-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_unitize, organization={Wolfram Research}, title={Unitize}, year={2007}, url={https://reference.wolfram.com/language/ref/Unitize.html}, note=[Accessed: 04-June-2025 ]}

@online{reference.wolfram_2025_unitize, organization={Wolfram Research}, title={Unitize}, year={2007}, url={https://reference.wolfram.com/language/ref/Unitize.html}, note=[Accessed: 04-June-2025 ]}