title: How to read file in matlab?
body: <p>I have a txt file, and the content of the file is rows of numbers,
  each row have 5 float number in it, with comma seperate between each number.
  example:</p>
  
  <p>1.1 , 12 , 1.42562, 3.5 , 2.2</p>
  
  <p>2.1 , 3.3 , 3 , 3.333, 6.75</p>
  
  <p>How can I read the file content into matrix in matlab?
  So far I have this:</p>
  
  <pre><code>fid = fopen('file.txt');
  comma  = char(',');
  A = fscanf(fid, ['%f', comma]);
  fclose(fid);
  </code></pre>
  
  <p>The problem is that it's only give me the first line and when I
  try to write the content of A I get this:  1.0e+004 * some number</p>
  
  <p>Can someone help me please?
  I guess that for the file I need to read it in a loop but I don't know how.</p>
  
  <p>Edit: One more question: When I do output to A I get this:</p>
  
  <pre><code>A =
  
  1.0e+004 *
  4.8631         0         0         0    0.0001
  4.8638   -0.0000   -0.0000    0.0004    0.0114
  4.8647   -0.0000   -0.0000    0.0008    0.0109
  </code></pre>
  
  <p>I want the same values that in the file to be in the matrix, how can I make the numbers to be regular float and not formatted like this? Or are the numbers in the matrix actually float, but the output is just displayed like this? </p>