|
From: | Mark Lytle |
Subject: | In this example code, I can't get interpl or spline to produce output, whats wrong? |
Date: | Tue, 3 Apr 2012 14:41:53 -0700 (PDT) |
Hi all, Here is the code I am testing with: 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,-.05);
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]) I do get plots for figures 2 and 3, but they are empty. Scratching my head...How do you interpolate randomly spaced data? Any help is appreciated... Thanks, Mark Lytle Houston |
[Prev in Thread] | Current Thread | [Next in Thread] |