title: matlab-return matrix
body: <p>I need help please, How do I return a matrix from a function in matlab?
  I have a matrix with zeros(size NxN). I send the matrix to some function to update her.
  How do I return the updated matrix?</p>
  
  <p>in a code:</p>
  
  <pre><code>matrix = zeros(size); %put zeros
  updateMatrix(radius,x0,y0,matrix);%call to function
  
  function updateMatrix(radius,x0,y0,matrix)
      update the matrix
  end
  
  continue the prog with the updated matrix
  </code></pre>
  
  <p>I just need to return the updated matrix, and I don't change the other variables.</p>
  
  <p>I tried to do this:</p>
  
  <pre><code>matrix = zeros(size); %put zeros
  matrix=updateMatrix(radius,x0,y0,matrix);%call to function
  
  function [matrix]=updateMatrix(radius,x0,y0,matrix)
      update the matrix
  end
  
  continue the prog with the updated matrix
  </code></pre>
  
  <p>But it doesn't work.</p>
  
  <p>Thanks!</p>