clear; clc
% Set number of iterations and wavelet name. 
%axis on
iter = 5;
wav = 'db5';
%wav = 'morl';
[phi,psi,xval] = wavefun(wav,iter);
hold on
%funkcia=(xval.*xval-5*xval);
funkcia=(3);
sucin=funkcia.*psi;
plot( xval,psi,'red');
hold on
plot(xval,funkcia,'green');
plot(xval,sucin,':blue');

%priebeh sumacie
size=length(xval);
mysum=zeros(1,size);
for x=2:size
   mysum(x)=mysum(x-1)+sucin(x)
end
plot(xval,mysum/100,'black');

%vysledok je skalarneho sucinu je toto
vysledna_suma=sum(sucin(:))

    
 