title: Error in vector fitting with spline (Interpolation)
body: <p>I've got an problem with fitting of a vector.</p>
  
  <p>I have 2 curves with the same function, which I want to compare. But each curve have a other timevector because they have a different samplingrate (only tstart = 0 and tend = 8.853958 are same).</p>
  
  <p>So I tried to interpolate the short vector to the same length like the long vector... But I dont get it.. In a other simulation it works... But not here...</p>
  
  <p>The error-message is:</p>
  
  <p>Error using chckxy (line 51)
  The data sites should be distinct.</p>
  
  <p>Error in spline (line 54)
  [x,y,sizey,endslopes] = chckxy(x,y);</p>
  
  <p>Error in Labor_2ndReceiver (line 434)</p>
  
  <p>dInt = spline(tspline,d,t1);</p>
  
  <p>My code:</p>
  
  <pre><code>tstart = 0;
  tstep = 1/fs;
  tend = (pi/((1/5)*2))-tstep;
  tendSync = 1;                       %Wait for 1 sec
  
  t0 = tstart:tstep:tendSync;         %Time for synchronisation
  t01 = tendSync+tstep:tstep:tend;    %Time after synchronisation to Tend
  t1 = [t0 t01];                      %Complete Time
  
  dInt = spline(tspline,d,t1);
  </code></pre>
  
  <p>where</p>
  
  <pre><code>%tspline &lt;1x32605 double&gt;:
  
  %Columns 1 through 24000 all values are '1' 
  %and Column 24001 is 0.249041666666667 
  %and Column 24002 to 32605 are some increasing values to 8.852958333333334 (but without a constant sampling rate) 
  
  %d &lt;1x32605 double&gt;; t1 &lt;1x424992 double&gt;
  </code></pre>
  
  <p>So could you help me please? It is very important...</p>
  
  <p>Thank u so much!</p>
  
  <p>EDIT:
  Thanks, but there is still a problem... see figure...</p>
  
  <pre><code>tspline =0:t1(end)/length(d):t1(end)-t1(end)/length(d);
  dInt = spline(tspline,d,t1);
  </code></pre>
  
  <p>So the Interpolation works... but the Values are wrong... because dInt starts too late.. it shout start like d..</p>
  
  <p>How could I solve this?</p>
  
  <p><a href="http://postimg.org/image/s8hnk1621/" rel="nofollow">http://postimg.org/image/s8hnk1621/</a></p>