title: Switching between Panels using MATLAB GUIDE
body: <p>I have been exploring some layouts on MATLAB GUI and will like to know if its possible to have a couple Panels on top of each other and then select between one or the other based on a button.</p>
  
  <p>What I have done till now is created a GUI using GUIDE. On that I created Panel 1 with a static text inside it saying "Panel 1 visible" and another Panel 2 with a static text inside it saying " Panel 2 visible". I also created two Push Buttons one to display Panel 1 only and other to display Panel 2 only</p>
  
  <p>Observation:
  1) When I have the Panels located at different positions, the Push buttons work as expected<img src="https://i.stack.imgur.com/v5HL2.png" alt="enter image description here">
  2) When I have the Panels located on top of each other, or even when they are partially overlapping only Push Button for Panel 1 work as expected. The push button for Panel 2 displays nothing (instead of displaying only Panel 2)<img src="https://i.stack.imgur.com/XPxoe.png" alt="enter image description here"></p>
  
  <p>Can someone please explain if there is a way to have multiple Panels on top of each other and then viewing only 1 of them at a time during run time (using GUIDE).</p>
  
  <p>GUIDE .m file is as below:</p>
  
  <pre><code>function varargout = PanelTest(varargin)
  gui_Singleton = 1;
  gui_State = struct('gui_Name',       mfilename, ...
                     'gui_Singleton',  gui_Singleton, ...
                     'gui_OpeningFcn', @PanelTest_OpeningFcn, ...
                     'gui_OutputFcn',  @PanelTest_OutputFcn, ...
                     'gui_LayoutFcn',  [] , ...
                     'gui_Callback',   []);
  if nargin &amp;&amp; ischar(varargin{1})
      gui_State.gui_Callback = str2func(varargin{1});
  end
  
  if nargout
      [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
  else
      gui_mainfcn(gui_State, varargin{:});
  end
  
  
  function PanelTest_OpeningFcn(hObject, eventdata, handles, varargin)
  handles.output = hObject;
  guidata(hObject, handles);
  
  
  function varargout = PanelTest_OutputFcn(hObject, eventdata, handles) 
  varargout{1} = handles.output;
  
  
  function Panel1_Callback(hObject, eventdata, handles)
  set(handles.Panel1Tag,{'visible'},{'on'})
  set(handles.Panel2Tag,{'visible'},{'off'})
  
  function Panel2_Callback(hObject, eventdata, handles)
  set(handles.Panel1Tag,{'visible'},{'off'})
  set(handles.Panel2Tag,{'visible'},{'on'})
  </code></pre>
  
  <p>Thanks</p>