% Estimation of the condition number for the matrix obtained
% for non-orthogonal polynomial approximation
function spectr_01
echo off, clc
clear all
Nmin = 2;
Nmax = 500;
N = Nmin;
k = 1;
while ( N <= Nmax );
% asseembling the matrix
for i=1:N
for j=1:N
A(i,j) = (i/N)^(j-1);
end;
end;
% estimating the condition number;
D(k,1) = N;
D(k,2) = cond(A);
k = k + 1;
N = N * 2;
end;
figure(1); loglog(D(:,1),D(:,2),'-x');