How to write smart coding ?
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!