You are on page 1of 1

>> t = [2 2.7 3.

8 6 8 10 13 16 18 21 25 30 36];
>> p = [5 7.8 9 10 10.2 10.3 10.4 14.5 15 15.4 15.5 14 5];
>> x = 1:0.8:40;
>> y = interp1 (t, p, x, 'spline');
>> plot (t, p,'o',x, y)
hold on
>> t = [2 3 36];
>> p = [5 4 5];
>> x = 12:0.8:40;
y = interp1 (t, p, x, 'linear') ; plot (x, y,'r')
hold on
t = [3 7 12];
p = [4 7.9 3.8];
x = 1:0.4:12;
y = interp1 (t, p, x, 'spline');
plot (t, p,'o',x, y)

You might also like