#1
#clg
#axis([-.1 1.1 -1.5 1.5])
#x=[0:.01:1];y=mf(x);plot(x,y,'-;mf;')
#x=[0:.01:1];y=mf(2*x-1);plot(x,y,'-;f(1,1);')
#x=[0:.01:1];y=mf(x-1);plot(x,y,'-;f(0,1);')
#x=[0:.01:1];y=mf(2*x);plot(x,y,'-;f(1,0);')
#x=[0:.01:1];y=mf(4*x-1);plot(x,y,'-;f(2,1);')
clg;

x=[0:.001:1];
y=1+2*sin(2*x*pi);
#y=sin(2*pi*sin(2*x*pi));
plot(x,y,'-g;sin;');
co=trapz(x,y);
c=haar(y,3);z=co+haarval(c,x);plot(x,z,'-r;0;');
coef=getsteps(c)+co;
lc=min(size(c));
xi=[1/2^(lc+1):1/2^lc:1];
plot(xi,coef,'b*')

c=haar(y,5);z=haarval(c,x);plot(x,z,'-b;3;');
coef=getsteps(c);
lc=min(size(c));
xi=[1/2^(lc+1):1/2^lc:1];
plot(xi,coef,'r*')
#c=haar(y,3);z=haarval(c,x);plot(x,z,'-m;3;');
#c=haar(y,4);z=haarval(c,x);plot(x,z,'-6;4;');
