title: Reading a CSV file and plotting graph using Matlab
body: <p>I would like to create a script in Matlab that can read data from a CSV file and plot it. My data looks something like:</p>
  
  <p>Time    BPM(HeartRate)<br>
  5:55:26      0<br>
  5:55:26      0<br>
  5:55:27      66<br>
  5:55:27      70<br>
  5:55:27      71<br>
  5:55:27      74<br>
  ...</p>
  
  <p>I would like to plot time on the x axis and BPM on the y axis. I have tried the following:</p>
  
  <pre><code>clear, clc;
  ftoread = 'data.csv';
  fid = fopen(ftoread);
  
  y=data(:,1);
  x=data(:,2);
  plot(x,y);
  xlabel('Time');
  ylabel('Heart Rate');
  title('Heart Rate Vs. Time');
  </code></pre>
  
  <p>Unfortunately, I am getting an error at <code>y=data(:,1)</code>.</p>