% Set number of iterations and wavelet name. 
%axis on
close all;
iter = 10;
wav = 'db3';
skladani=3;
sklon=1;
rad_polynomu=2;

[phi,psi,xval] = wavefun(wav,iter);
[x, velkost] = size(xval);
nosic = xval(velkost);
total_size=floor(velkost+skladani*velkost/nosic)+10;
func_long = zeros(1, total_size);
for(i=1:total_size) 
    func_long(i)=i-1;
end
func_long=(sklon*func_long/total_size).^rad_polynomu;
plot(func_long,'red');
hold on

posun = floor(velkost/nosic);
for i=1:skladani
    pole = zeros(1, total_size);
    pole(1+posun*i:1+(posun)*i+(velkost-1)) = psi(1:velkost);
    plot(pole);
    skalarny_sucin=func_long*pole';
    msg=sprintf('Skalarny sucin [%d] = %f' , i, skalarny_sucin);
    disp(msg);
end