Why does this plot correspond to this function? I have a function: 

$$
u_1(\mathbf{x})=
\begin{cases}
1, &amp; \text{if} \;\;|x_1|\le r_1, |x_2| \le r_2 \\
0, &amp; \text{otherwise}
\end{cases}
,\mathbf{x}=[x_1,x_2]^T \in \mathbb{R}^2
$$

And I'm told that if $r_{1}=r_{2}=5$, then plotting it in Matlab with stem3 should look like this:



Maybe I'm just too exhausted at this point, but I don't see how this is the same function. It looks like it's equal to 1 between 10 and 20 rather than between -5 and 5? Can someone please explain what's going on here?
The axes in your plot seem to be indexes into an array, as if you were using stem3(Z) instead of stem3(X,Y,Z).

Check the example in the documentation.