title: Interpolation Errors, plot function does not generate proper lines when running
body: <p>I am trying to get a graph made for my interpolation program (basically it takes a test function and creates lines utilizing an <code>interpolation method</code>)</p>
  
  <pre><code>clear all;
  close all; 
  clc;
  
  x1= [-1 0.75 -0.5 -0.25 0 0.25 0.5 0.75 1];
  x2=-1:1001:1;
  
  y1=1./(1+25.*x1.^2);
  y2=1./(1+25.*x2.^2);
  figure(777)
  title('Figure 777')
  for loop=1:1:6
  
      subplot(6,2,loop);
      plot(x2,y2,'linewidth',2);
      hold on
      plot(x1,y1,'r.','markersize',25);
      hold on
  end
  %%%(A)
  [p1,s1,u1] = polyfit(x1,y1,4);
  Y1=polyval(p1, x2, s1, u1);
  subplot (6,2,1)
  plot(x2,Y1,'b','linewidth',6);
  
  %%%(B)
  [p2, s2, u2] = polyfit(x1,y1,8);
  Y2 = polyval(p2, x2, s2, u2);
  subplot(6,2,1)
  plot(x2,Y2, 'b', 'linewidth', 6);
  
  %%%(C)
  Y3 = interp1(x1, y1, x2, 'linear');
  subplot(6,3,1)
  plot(x2, Y3, 'b', 'linewidth', 6);
  
  %%%(D)
  Y4 = interp1(x1,y1,x2, 'nearest');
  subplot(6,4,1)
  plot(x2, Y4, 'b', 'linewidth', 6);
  
  %%%(E)
  Y5 = interp1(x1,y1,x2, 'spline');
  subplot(6,5,1)
  plot(x2, Y5, 'b', 'linewidth', 6);
  
  %%%(F)%%%(This method does not exist for Matlab R2017a)
  Y6 = interp1(x1,y1,x2, 'makima');
  subplot(6,6,1)
  plot(x2, Y6, 'b', 'linewidth', 6);
  </code></pre>
  
  <p><strong>However, none of the lines appear when I run the program. Only the dots. Furthermore I receive these errors:</strong></p>
  
  <blockquote>
    <p>Warning: Polynomial is badly conditioned. Add points with distinct X values or
    reduce the degree of the polynomial. 
    In <code>polyfit (line 73)</code>
      In <code>HwSixTwo (line 27)</code></p>
    
    <p>Error using <code>griddedInterpolant</code>
    The grid vectors must contain unique points.</p>
    
    <p>Error in interp1 (line 149)
    <code>F = griddedInterpolant(X,V,method);</code></p>
    
    <p>Error in HwSixTwo (line 33)
    <code>Y3 = interp1(x1, y1, x2, 'linear');</code></p>
  </blockquote>