% Set number of iterations and wavelet name. 
%axis on
iter = 5;
wav = 'db2';
%wav = 'morl';
[phi,psi,xval] = wavefun(wav,iter);
%hold on
%funkcia=(xval.*xval-5*xval);
funkcia=(3*xval);
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(:));


t1=(1:97);
%figure
%plot(t1,phi)

pole1=2*phi(1:32);
pole2=2*phi(33:64);
pole3=2*phi(65:96);

pole01=pole1;
pole02=pole1+pole2;
pole03=pole2+pole3+pole1;
pole04=pole3+pole2+pole1;
pole05=pole3+pole2+pole1;
pole06=pole3+pole2;
pole07=pole3;




pole=[pole01 pole02 pole03 pole04 pole05 pole06 pole07];

  t2=(1:32*7);

figure
plot(t2,pole)  
 