% Decompose the signal s at level 5 using the wavelet db3.
w = 'db3';
[c,l] = wavedec(s,5,w);
% Reconstruct the details using the decomposition structure.
for i = 1:5
D(i,:) = wrcoef('d',c,l,w,i);
end
% Avoid edge effects by suppressing edge values and plot.
tt = 1+100:length(s)-100;
subplot(6,1,1); plot(tt,s(tt),'r');
for i = 1:5
subplot(6,1,i+1); plot(tt,D(5-i+1,tt),'g');
end