f the coordinate, or -1 if it does not exist</p><pre class="codeinput">        <span class="keyword">function</span> clicked = indexOf(obj, x, y)
            <span class="comment">% Check if empty first</span>
            <span class="keyword">if</span> isempty(obj.stack)
                clicked = -1;
            <span class="keyword">else</span>
                in = find(obj.stack(:, 1) == x &amp; obj.stack(:, 2) == y);

                <span class="keyword">if</span> isempty(in)
                    clicke