title: define variable by concatenating strings
body: <p>I want to iteratively define a variable whose name is the concatenation of two strings.</p>
  
  <p>In particular, the following code is meant to create a variable <strong>Uvel_spring</strong> that contains the values <strong>Uvel</strong> stored in the file <strong>spring_surface.mat</strong> :</p>
  
  <pre><code>seasons{1}='spring';
  seasons{2}='summer';
  seasons{3}='autumn';
  seasons{4}='winter';
  
  for ii=1:4
  
      ['Uvel_',char(seasons(ii))] = load([char(seasons(ii)),'_surface.mat'],...
               'Uvel');
  
  end
  </code></pre>
  
  <p>However, I get the following error:</p>
  
  <blockquote>
    <p>An array for multiple LHS assignment cannot contain LEX_TS_STRING.</p>
  </blockquote>
  
  <p>I solved it by using <code>evalc</code>:</p>
  
  <pre><code>for ii=1:4
  
     evalc( sprintf(['Uvel_',char(seasons(ii)),'=','load(''',char(seasons(ii)),'_surface.mat'',',...
               '''Uvel''',')']) );
  
  end
  </code></pre>
  
  <p>However, it is horrible and I would like to improve the code. </p>
  
  <p>Does someone have an alternative solution?</p>