title: Matlab - Why sometimes xslread doesn't let use a number as a sheet argument?
body: <p>I want to read an excel file with 10 sheets with matlab with the xlsread function like this:</p>
  
  <pre><code>SPLByFrequency = zeros(173, 10);
  for i = 1:10
      rawData = xlsread('mediciones', i);
      SPLByFrequency(:, i) = rawData(84:256, 3);
  end
  </code></pre>
  
  <p>It's not the first time I read excel sheets using a number as argument and I've never had any problem but this time it doesn't let me do it and I get this error:</p>
  
  <pre><code>Error using xlsread (line 207)
  In basic mode, sheet argument must be a string.
  
  Error in TareaB53 (line 11)
      rawData = xlsread('mediciones', i);
  </code></pre>
  
  <p>I haven't been able to change this 'basic' mode and doing some debugging I've found that, strangely enough, xlsread('mediciones', 1) works but it doesn't work with any other number.</p>
  
  <p>Doing some research I've found there is a way to escape from this problem by using xlsinfo to get the sheet names and then use the sheet strings as an argument but I don't understand why I couldn't do it simply directly with a number, why I can do it just with the number 1 or why it suddenly doesn't work while I've always been doing it with a number as an argument.</p>
  
  <p>Is there a way to solve this and use directly a number as a sheet argument?</p>
  
  <h1>Edit - Summary and new information</h1>
  
  <p>If you don't have <strong>Excel for Windows</strong> installed, <code>xlsread</code> operates in basic mode so you cannot use a number for the sheet argument.</p>
  
  <p>Therefore, for portability, it would be better to use <code>xlsinfo</code> to get the sheet strings.</p>
  
  <p>For some reason, even if it seems it isn't supposed to, (for me) it worked on OS X 10.9. However, it doesn't work anymore on OS X 10.11 (I have Matlab release 2012a).</p>