%% Extrapolation Using Cubic Spline
% Extrapolate a data set to predict population growth.
% Create two vectors to represent the census years from 1900 to 1990 (t) and the corresponding United States population in millions of people (p).

t = 1900:10:1990;
p = [ 75.995  91.972  105.711  123.203  131.669 ...
     150.697 179.323  203.212  226.505  249.633 ];

%
% Extrapolate and predict the population in the year 2000 using a cubic spline.

spline(t,p,2000)

% Copyright 2015 The MathWorks, Inc.