clc; close all;
load woman;
[c, s] = wavedec2(X, 3, 'haar');
[H1, V1, D1] = detcoef2('all', c, s, 1);
A1 = appcoef2(c, s, 'haar', 1);
figure; subplot(2, 2, 1); imshow(A1, []); title('Approximation Coef. of Level 1');
subplot(2, 2, 2); imshow(H1, []); title('Horizontal Detail Coef. of Level 1');
subplot(2, 2, 3); imshow(V1, []); title('Vertical Detail Coef. of Level 1');
subplot(2, 2, 4); imshow(D1, []); title('Diagonal Detail Coef. of Level 1');
[H2, V2, D2] = detcoef2('all', c, s, 2);
A2 = appcoef2(c, s, 'haar', 2);
figure; subplot(2, 2, 1); imshow(A2, []); title('Approximation Coef. of Level 2');
subplot(2, 2, 2); imshow(H2, []); title('Horizontal Detail Coef. of Level 2');
subplot(2, 2, 3); imshow(V2, []); title('Vertical Detail Coef. of Level 2');
subplot(2, 2, 4); imshow(D2, []); title('Diagonal Detail Coef. of Level 2');
[H3, V3, D3] = detcoef2('all', c, s, 3);
A3 = appcoef2(c, s, 'haar', 3);
figure; subplot(2, 2, 1); imshow(A3, []); title('Approximation Coef. of Level 3');
subplot(2, 2, 2); imshow(H3, []); title('Horizontal Detail Coef. of Level 3');
subplot(2, 2, 3); imshow(V3, []); title('Vertical Detail Coef. of Level 3');
subplot(2, 2, 4); imshow(D3, []); title('Diagonal Detail Coef. of Level 3');
Best Answer