title: MATLAB - load file whose filename is stored in a string
body: <p>I am using MATLAB to process data from files. I am writing a program that takes input from the user and then locates the particular files in the directory graphing them. Files are named:</p>
  
  <blockquote>
    <p>{name}U{rate}</p>
  </blockquote>
  
  <p>{name} is a string representing the name of the computer. {rate} is a number. Here is my code:</p>
  
  <pre><code>%# get user to input name and rate
  NET_NAME = input('Enter the NET_NAME of the files: ', 's');
  rate = input('Enter the rate of the files: ');
  
  U = strcat(NET_NAME, 'U', rate)
  load U;
  
  Ux = U(:,1);
  Uy = U(:,2);
  </code></pre>
  
  <p>There are currently two problems:</p>
  
  <ol>
  <li><p>When I do the <code>strcat</code> with say 'hello', 'U', and rate is 50, U will store 'helloU2' - how can I get <code>strcat</code> to append {rate} properly?</p></li>
  <li><p>The load line - how do I dereference U so load tries to load the string stored in U?</p></li>
  </ol>
  
  <p>Many thanks!</p>