title: Error: Attempted to access data(2,:); index out of bounds because size(data)=[1,7129]
body: <p>I have a micro-array data of 38 row and 7130 columns. I am trying to read the data but keeping having the above error.</p>
  
  <p>I debugged and found when I read the data, I have a 1x7129 instead of a 38x7130. I don't know why. My 7130th column contains letters while the rest of the data are numbers. Any idea why this is happening?</p>
  
  <hr>
  
  <p>My file is in text tab delimited and here is my code for reading the file: </p>
  
  <pre><code>clear; 
  fn=32; 
  col=fn+1; 
  cluster=2; 
  num_eachClass=3564; 
  row=num_eachClass*cluster; 
  fid1 = fopen('data.txt', 'r'); 
  txt_format=''; 
  for t=1:col txt_format=[txt_format '%g ']; 
  end 
  data = fscanf(fid1,txt_format,[col row]); 
  data = data'; fclose(fid1); 
  </code></pre>