I don't understand about this row and column??

3 views (last 30 days)
who know about this code? if N=8 and L=512
for i= N:N:L-N
for j = 1:L
and this one
for i= 1:L
for j= N:N:L-N
what is the different? thanx for any advance.

Accepted Answer

Image Analyst
Image Analyst on 28 Apr 2013
Well the first one starts at row (or column) 8 while the second one starts at 1. There are some other differences but you can just print them out to see:
N=8
L=512
i= N:N:L-N
j = 1:L
i= 1:L
j= N:N:L-N
Then look in the command window to see what they are.
  4 Comments
Image Analyst
Image Analyst on 28 Apr 2013
S is the rectangular sub-image at that location. So to get the sum at each location, you'd do
theSum(i, j) = sum(S(:));
Not sure how you want to find the threshold though.
troy
troy on 28 Apr 2013
Edited: troy on 28 Apr 2013
how to modify the for loop of i and j to get value odd number? thanks sir.

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!