% a matlab script to demonstrate 
% piecewise linear interpolation
% we use the default behaviour of the plot routine to do this

% create the data
x = 1:6;
y = [16 18 21 17 15 12];

% plot will connect the dots with straight lines
plot(x,y,'o',x,y,'-');