MATLAB: Error using ==> plot

plot

I have a code
x = rand(64,64,16);
J = 1;
[Faf, Fsf] = FSfarras;
[af, sf] = dualfilt1;T=10;
w = dualtree3D(x, J, Faf, af);
details = Erry{1}{1}{1};
energy = sum(sum(abs(details).^2));
then i plotted the graph using plot command
plot(energy)
but i get errror
Error using ==> plot
Data may not have more than 2 dimensions
please help

Best Answer

Hi Kash, I think you need to form the complex-valued matrices out of the two DWT trees and then sum the squared magnitudes from all the detail subband matrices. See this example.
x = rand(64,64,16);
J = 1;
[Faf, Fsf] = FSfarras;
[af, sf] = dualfilt1;T=10;
w = dualtree3D(x, J, Faf, af);
for k = 1:7
coefs = w{1}{1}{k}+1j*w{1}{2}{k};
energy(k) = sum(abs(coefs(:)).^2);
end
plot(energy,'b^-','markerfacecolor',[0 0 1])
xlabel('Detail Subbands'); ylabel('Energy');