      <span class="keyword">end</span>
            <span class="keyword">end</span>

            <span class="comment">% Erase handles to removed interactions from global list</span>
            <span class="keyword">if</span> (rmv)
                drv.interacts(~isvalid(drv.interacts)) = [];
            <span class="keyword">end</span>

            <span class="comment">% Update total number of interactions</span>
            drv.n_interacts = length(drv.interacts);

            <span class="comment">% Set