我正在处理这段代码,但我不知道哪里出错了
这是显示错误的代码部分:
sf_num=0; sf_den=0;a=0; o=0;
for i=1:512
for j=1:512
sf_num=sf_num+(w1(i,j)*o(i,j));
a=a+(o(i,j)*o(i,j));
b=b+(w1(i,j)*w1(i,j));
sf_den = sqrt(sf_den + a*double(b));
end
end
这是错误:
Attempted to access o(1,2); index out of bounds because numel(o)=1.
Error in ==> dwtcode at 44
sf_num=sf_num+(w1(i,j)*o(i,j));