title: How to concatenate strings in a loop?
body: <p>How to concatenate strings in a loop?
  For example I have this character array</p>
  
  <pre><code>fruits = char('apple','pear')
  </code></pre>
  
  <p>I would like to see this output</p>
  
  <pre><code>  apple tart
    pear tart
  </code></pre>
  
  <p>But when I use this loop:</p>
  
  <pre><code>for f = fruits'
    strcat(f," tart")
  end
  </code></pre>
  
  <p>The output is </p>
  
  <pre><code>ans =
  
  a tart
  p tart
  p tart
  l tart
  e tart
  
  ans =
  
  p tart
  e tart
  a tart
  r tart
   tart 
  </code></pre>
  
  <p>In fact I need this to read a bunch of csv files in a directory. Part of the file name is a variable over which I want to loop over. For example my directory contains the 2 following files from which I want to read data:</p>
  
  <pre><code>peartart.csv
  appletart.csv
  </code></pre>
  
  <p>This <a href="https://stackoverflow.com/questions/11621846/loop-through-files-in-a-folder-in-matlab">other answer using a list of files</a> is nice but then I have no control over the <code>fruit</code> variable name in the file. I wand control over this variable because I will perform a statistical test for each fruit data and store the test result with the fruit name in another file.</p>