How to modify for loop of i and j to get value odd number?
57 次查看(过去 30 天)
显示 更早的评论
I2 = imread('......');
I2 = rgb2gray (I2);
N=8; %N= window size (8x8)
[L,L]=size(I2);
L2=L/N;
S=zeros(L,L);
for i=1:L2
for j=1:L2
S=I2((i-1)*N+1:i*N,(j-1)*N+1:j*N);
theSum(i, j) = sum(S(:));
end;
end;
采纳的回答
the cyclist
2013-5-1
Do you mean, for example,
i=1:2:L2
?
This would loop over i = 1,3,5, ..., L2
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!