help-octave
[Top][All Lists]
Advanced

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

Re:In this example code, I can't get interpl or spline to produce output


From: Mark Lytle
Subject: Re:In this example code, I can't get interpl or spline to produce output, whats wrong?
Date: Tue, 3 Apr 2012 15:37:41 -0700 (PDT)

One more question....

I now have tried to take the output from either the spline of interpl1 functions and then feed it into an fft.  The spline output produces one spike at an x-value of about .208, the interpl1 produces a blank chart (puzzling).

The whole code list now looks like this:

x=[0,.11,.15,.18,.25,.32,.35,.39,.42,.44,.48,.50];

y = [0, 1, 3, 5, 12, 10, 9, 7, 5, 3, 7, 10];

figure(1)

plot(x,y);

x1=linspace(0,5,101)

y1 = spline(x,y,x1);

figure(2)

plot(x1,y1);

axis([0, .5, 0, 15])


y2 = interp1(x,y,x1);

figure(3)

plot(x1,y2);

axis([0, .5, 0, 15])


q = fft(y1);

figure(4)

plot (x1,q);

axis([0, .5, 0, 25])


The line 'q=fft(y1)' is where I switch from testing either the spline (y1) or the interpl1 (y2) output.


I'm wondering if I have done this right...or have missed something?...



reply via email to

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