title: getappdata returning empty matrix in MATLAB
body: <p>I have a piece of code in which I use <code>setappdata</code> and then later on I call the data using <code>getappdata</code> which returns an empty matirx even though it is not empty. A segment of my simplified code is below:</p>
  
  <pre><code>function edit1_Callback(hObject, eventdata, handles)
  
  C=str2double(get(hObject,'String'))
  setappdata(hObject,'H',C)
  
  % --- Executes during object creation, after setting all properties.
  function edit1_CreateFcn(hObject, eventdata, handles)
  
  if ispc &amp;&amp; isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
      set(hObject,'BackgroundColor','white');
  end
  
  
  % --- Executes on button press in pushbutton1.
  function pushbutton1_Callback(hObject, eventdata, handles)
  
  N=getappdata(hObject,'H')
  </code></pre>
  
  <p>When I run the code I enter a value into the <code>editbox</code> then push the <code>pushbutton</code>, I get the following output</p>
  
  <pre><code>C =
  
       5
  
  
  N =
  
       []
  </code></pre>
  
  <p>I would like the following output</p>
  
  <pre><code>C =
  
       5
  
  
  N =
  
       5
  </code></pre>
  
  <p>I should explain that I am using <code>getappdata</code> and <code>setappdata</code> as I want to pass data between different GUI's, and I am having the empty matrix problem when doing this. So this is a very simplified problem of my final goal. I have also read a lot of different articles and the information on this problem and commands, including the mathworks site but I am pretty lost with this problem.</p>