clc
clear all
close all

%% Initialization

x=[1 2 3 4];
y=[1 5 15 602];
xstar=linspace(min(x),max(x),30);

%% Coefficients of polynomial interpolation
vandermonte=vander(x);
c=vandermonte\y';

%% Polynomial function evaluation
vandermonte_star=vander(xstar);
vandermonte_star=vandermonte_star(:,end-length(x)+1:end);
ystar=vandermonte_star*c;

plot(x,y,'k*',xstar,ystar,'k-')
