title: Read matrix from GUI object
body: <p>I'm writing a program that performs Gauss elimination, and I want to create a GUI for this. For example, if the user wants to input a 2×2 matrix, I want 4 text boxes to appear in the GUI. My problem is that I don't know how to read the values from these objects. My code is below:</p>
  
  <pre><code>n=3;
  b=50;   
  a=200;
  for i=1:n    
      for j=1:n
          A(i,j) = uicontrol('style','edit','units','pixels',...
                   'position',[b a 50 50],'fontsize',20,'string','');
         b = b+60;
      end
      b = 50;
      a = a-60;
  end
  
  uiwait
  
  for i=1:n
      for j=1:n
          B(i,j) = str2double(get(A(i,j),'String'));
      end
  end
  </code></pre>
  
  <p>How to get the input data from <code>A</code> to <code>B</code>?</p>