title: How to import multiple files in matlab, using uigetfile and importdata?
body: <p>I want to select multiple files, import the data from the files and use them in GUI program.<br>
  The code I am using to get the multiple files works perectly well:  </p>
  
  <pre><code>[FileName,PathName,FilterIndex] = uigetfile('*.txt*','Study Files','MultiSelect','on')
  
  Cols = size(FileName,2);
  numfiles = Cols;
  
  
  for i = 1:numfiles
      FileName(i)
  
      entirefile =fullfile(PathName,FileName(i))
  end   
  </code></pre>
  
  <p>My problem is when I try to open <code>entire file</code>. The method I'm trying to use works with a single file but not here.When the code in the loop is:  </p>
  
  <pre><code>for i = 1:numfiles
      FileName(i)
  
      entirefile =fullfile(PathName,FileName(i))
  
   A = [];
   fid = fopen(entirefile);
  
   tline = fgets(fid);
   while ischar(tline)
       parts = textscan(tline, '%f;');
       if numel(parts{1}) &gt; 0
           A = [ A ; parts{:}' ];
        end
       tline = fgets(fid);
  
   end  
  end  
  </code></pre>
  
  <blockquote>
    <p>Error using fopen   First input must be a file name of type char, or a
    file identifier of type double.  </p>
    
    <p>Error in multiselect (line 14)    fid = fopen(entirefile);</p>
  </blockquote>
  
  <p>It also only gives me the first and last file selected and then only the <code>entirefile</code> of the first selected file.  </p>
  
  <p>Anyone any suggestions on how I could resolve this issue?</p>