How to create nested loop for following equation?
Show older comments
It divides image into 2 subimage based on mean. How I enter values in nested loop for first PDF(Pl) from (1 <= mean) & for second PDF(Pu) from (mean+1 > last value)

6 Comments
Jan
on 5 Feb 2021
What have you tried so far?
KALYAN ACHARJYA
on 5 Feb 2021
I think, you can avoid nested loop here.
Jagdeep S
on 5 Feb 2021
Your code does not run.
I1=(I(r,c)<=Im);
I2=(I(r,c)>Im);
Now I1 and I2 are scalars. Then:
for i=1:r
for j=1:c
value1=I1(i,j);
must fail.
Do you mean:
I1 = (I <= Im);
I2 = (I > Im);
Why do you allocate 256 elements for f1 and f2, although you fill only the first two elements?
Are you sure, that the code does, what you expect?
Jagdeep S
on 6 Feb 2021
Jan
on 6 Feb 2021
You have posted several questions about the same problem. I've mentioned, that your code does not run at all and answered your comment above in one of your other threads already.
Please focus on one thread. Explain your problem uniquely and answer questions for clarifications. This will increase your chance to get a useful answer and avoids that posting an answer is a waste of time. Thanks.
Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!