help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interpolation time response


From: Przemek Klosowski
Subject: Re: Interpolation time response
Date: Mon, 13 Jul 2009 13:43:05 -0400 (EDT)

You are recalculating spline 10000+ times, getting the same result laboriously 
every time.
Use spline to calculate the individual datapoints, as explained in 'help spline'

a =[  1       1
      30       2
      60       8
      90      10
    7300      27
    7665      30
    8030      31
    8395      32
    8760      37
    9125      38
    9490      44
    9855      46
   10220      48
   10585      50
   10950      53  ];
y=spline(a(:,1),a(:,2),1:10950);
plot(a(:,1),a(:,2),"+-",1:10950,y)

As you can see, spline does some surprising things with sparse datasets; I 
would 
recommend the interpolation routines (interp1 for instance):

plot(a(:,1),a(:,2),"+-",1:10950,interp1(a(:,1),a(:,2),1:10950,"pchip"))

Try different interpolation algorithms, 'nearest' 'linear' 'cubic' 'spline'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]