% matlab script to demonstrate example of parametric interpolation

clear all
close all

% parameterization
t = [0:0.25:1];
% data
x = [-1,0,1,0,-1];
y = [0,1,0.5,0,-1];

% plot the data
plot(x,y,'*')
pause
hold on

% initialize plot points 
tPlot = [0:0.01:1];

% interpolate and plot the interpolant
px = polyinterp(t,x,tPlot);
py = polyinterp(t,y,tPlot);
plot(px,py)
xlabel('x', 'FontSize', 20)
ylabel('y', 'FontSize', 20)