title: Matlab: Error using readtable (line 216) Input must be a row vector of characters or string scalar
body: <p>I gave the error <code>Error using readtable (line 216) Input must be a row vector of characters or string scalar</code> when I tried to run this code in Matlab:</p>
  
  <pre><code>clear
  close all
  clc
  D = 'C:\Users\Behzad\Desktop\New folder (2)';
  filePattern = fullfile(D, '*.xlsx');
  file = dir(filePattern);
  x={};
  for k = 1 : numel(file)
      baseFileName = file(k).name;
      fullFileName = fullfile(D, baseFileName);
      x{k} = readtable(fullFileName);
      fprintf('read file %s\n', fullFileName);
  end
  % allDates should be out of the loop because it's not necessary to be in the loop
  dt1 = datetime([1982 01 01]);
  dt2 = datetime([2018 12 31]);
  allDates = (dt1 : calmonths(1) : dt2).';
  allDates.Format = 'MM/dd/yyyy';
  % 1) pre-allocate a cell array that will store
  %   your tables (see note #3)
  T2 = cell(size(x)); % this should work, I don't know what x is
  % the x is xlsx files and have different sizes, so I think it should be in
  % a loop?
  % creating loop
  for idx = 1:numel(x)
      T = readtable(x{idx});
      % 2) This line should probably be T = readtable(x(idx));
      sort = sortrows(T, 8);
      selected_table = sort (:, 8:9);
      tempTable = table(allDates(~ismember(allDates,selected_table.data)), NaN(sum(~ismember(allDates,selected_table.data)),size(selected_table,2)-1),'VariableNames',selected_table.Properties.VariableNames);
      T2 = outerjoin(sort,tempTable,'MergeKeys', 1);
      % 3) You're overwriting the variabe T2 on each iteration of the i-loop.
      % to save each table, do this
      T2{idx} = fillmissing(T2, 'next', 'DataVariables', {'lat', 'lon', 'station_elevation'});
  
  end
  </code></pre>
  
  <p>the x is each xlsx file from the first loop. my xlsx file has a different column and row size. I want to make the second loop process for all my xlsx files in the directory.
  did you know what is the problem? and how to fix it?</p>