hippo613
2010-01-20, 22:16
各位大大,小弟有个问题想请教!
for i=1:row %列优先方式
for j=1:col
t=mod(L(i,j),row);
if t==0
t=row;
xt1=floor(L(i,j)/row);
else
xt1=floor(L(i,j)/row)+1;
end
H(i,j)=E(t,xt1);
end
end
上面这段程序是我用来对图像像素位置根据矩阵L进行置乱的。是否可以优化提高MATLAB运行速度。
还有:for k=1:h
G(k)=round(yq(k)*127);
end
这段程序中,有提示说‘G’might be growing inside a loop. Consider preallocating for speed.这句话是什么意思
for i=1:row %列优先方式
for j=1:col
t=mod(L(i,j),row);
if t==0
t=row;
xt1=floor(L(i,j)/row);
else
xt1=floor(L(i,j)/row)+1;
end
H(i,j)=E(t,xt1);
end
end
上面这段程序是我用来对图像像素位置根据矩阵L进行置乱的。是否可以优化提高MATLAB运行速度。
还有:for k=1:h
G(k)=round(yq(k)*127);
end
这段程序中,有提示说‘G’might be growing inside a loop. Consider preallocating for speed.这句话是什么意思