title: handle structure empty with uiwait in matlab gui at output function
body: <p>I want to use uiwait according to this <a href="http://www.mathworks.de/de/help/matlab/creating_guis/making-multiple-guis-work-together.html#brav1u1" rel="nofollow">example code</a> for sharing data between guis.
  However if I call <code>uiwait(handles.figure1);</code> the handles structure is empty at <code>uitest_OutputFcn</code>.</p>
  
  <pre><code>function varargout = uitest(varargin)
  
  % Begin initialization code - DO NOT EDIT
  gui_Singleton = 1;
  gui_State = struct('gui_Name',       mfilename, ...
                     'gui_Singleton',  gui_Singleton, ...
                     'gui_OpeningFcn', @uitest_OpeningFcn, ...
                     'gui_OutputFcn',  @uitest_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
  % End initialization code - DO NOT EDIT
  
  
  % --- Executes just before uitest is made visible.
  function uitest_OpeningFcn(hObject, eventdata, handles, varargin)
  
  % Choose default command line output for uitest
  handles.output = hObject;
  
  % Update handles structure
  guidata(hObject, handles);
  
  % UIWAIT makes uitest wait for user response (see UIRESUME)
  % --&gt; enable to generate error
  % uiwait(handles.figure1);
  
  
  % --- Outputs from this function are returned to the command line.
  function varargout = uitest_OutputFcn(hObject, eventdata, handles) 
  % varargout  cell array for returning output args (see VARARGOUT);
  % hObject    handle to figure
  % eventdata  reserved - to be defined in a future version of MATLAB
  % handles    structure with handles and user data (see GUIDATA)
  
  % Get default command line output from handles structure
  varargout{1} = handles.output;
  
  % --------------------------------------------------------------------
  function menuClose_Callback(hObject, eventdata, handles)
  % hObject    handle to menuClose (see GCBO)
  % eventdata  reserved - to be defined in a future version of MATLAB
  % handles    structure with handles and user data (see GUIDATA)
  
  uiresume(handles.figure1);
  
  close(handles.figure1);
  </code></pre>