%% 1-D Interpolation
% Define the sample points and values.

x = [1 2 3 4 5];
v = [12 16 31 10 6];

%
% Define the query points, xq, and interpolate.

xq = (1:0.1:5);
vq = interpn(x,v,xq,'cubic');

%
% Plot the result.

figure
plot(x,v,'o',xq,vq,'-');
legend('Samples','Cubic Interpolation');

% Copyright 2015 The MathWorks, Inc.