title: dynamic variable declaration function matlab
body: <p>How to declare dynamic variable names in <em>Matlab</em>, and the function returns those variables?
  I want the function that returns the string with dynamic variable name and returns only when number of iterations <code>n</code> is given.</p>
  
  <p>I have tried the my following code:</p>
  
  <pre><code>    function [var] = myFunc(n)
  
      for ii=1:n
                var= ['var' num2str(ii)];
                var{ii} = strcat('(some srting', var,')');
                eval(['var' num2str(ii) ' = var']);
      end
      end
  </code></pre>