How to create nested loop for following equation?
Mostra commenti meno recenti
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 Commenti
Jan
il 5 Feb 2021
What have you tried so far?
KALYAN ACHARJYA
il 5 Feb 2021
I think, you can avoid nested loop here.
Jagdeep S
il 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
il 6 Feb 2021
Jan
il 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.
Risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!