title: Matlab checkbox gui
body: <p>I have a checkbox on GUI that draws a rectangle on a live video feed, however, I need the rectangle to dissapear or be deleted when I uncheck it.
  does anyone have any idea how to do this?</p>
  
  <p>This is my code, I have tried putting things in else, but nothing works.</p>
  
  <pre><code>function Box(hObject,eventdata)
  
  if (((get(hObject,'Value') == get(hObject,'Max'))))
   % Checkbox is checked-take appropriate action
   hold on;
  rectangle('Position',[50,50,100,100],'EdgeColor','r')
  else
  end
  </code></pre>