% m-file: demo_7.m
%
% (C) PK, 08/11/2018;

clc; clear; close all;
N=7;
xn=rand(N,1); xn=sort(xn);
yn=rand(N,1)-0.5;
for n=1:N,
   for m=N-1:-1:0,
       A(n,N-m)=xn(n)^m;
   end;    
end;    
A,
a=inv(A)*yn,
xx=xn(1):0.001:xn(end);
yy=polyval(a,xx);

    figure(1);
        plot(xn,yn,'ro'); grid on; hold on;
        plot(xx,yy,'b.-');

% EOF;