title: How to add a regression line to a scatter plot in MATLAB
body: <p>I am trying to add a regression line onto a plot in MATLAB.
  this is the code I have:</p>
  
  <pre><code>errorbar(x,y,SEM,'o')
  hold on % Retains current plot while adding to it
  scatter(x,y)
  title('The Effect of Distance Between Images on the Flashed Face         Distortion Effect','FontSize',14); % Adds title
  xlabel('Distance (Pixels)','FontSize',12); % Adds label on the x axis
  ylabel('Average Distortion Rating','FontSize',12); % Adds label on the y axis
  hold off
  </code></pre>
  
  <p>And this is my code for a regression:
      mdl = fitlm(x,y,'linear');</p>
  
  <p>Could anyone tell me how to combine the two so i get the regression line on the plot?
  I am using psychtoolbox on MATLAB on Windows.
  Thanks!</p>