How to write smart coding ?
Show older comments
Applying 3 level of DWT provide me 22 subbands. How do I write efficient coding for calculating the energy of 22 subbands. I have written the following code:-
function [E1,E2,E3,E4,E5,E6,E7,E8,E9,E10,E11,E12,E13,E14,E15,E16,E17,E18,E19,E20,E21,E22]=featener(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v)
[Sx,Sy,Sz]=size(a);
for x=1:Sx
for y=1:Sy
for z=1:Sz
E1=sum(sum(sum(a(x,y,z)*a(x,y,z))));
end
end
end
for loop etc for 22 subbabds. How to avoid these many for loops? Any help is appreciated.
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!