Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
How do I plot the following multi case function in wolfram or geogebra?
$$
\begin{eqnarray*}
f(x) =
\begin{cases}
1, &\text{if }x \text{ is an integer},
\\ 0, &\text{if }x \text{ is not an integer}.
\end{cases}
\end{eqnarray*}
$$
$\begingroup$Here's a piecewise defined function (but the graph isn't what you want -- I'd like to know how to do that as well): "Piecewise[{{1, x == Floor[x]}}, 0]" Link: wolframalpha.com/input/?i=Piecewise[{{1%2C+x+%3D%3D+Floor[x]}}%2C+0]$\endgroup$
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.