How to create nested loop for following equation?
古いコメントを表示
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 件のコメント
Jan
2021 年 2 月 5 日
What have you tried so far?
KALYAN ACHARJYA
2021 年 2 月 5 日
I think, you can avoid nested loop here.
Jagdeep S
2021 年 2 月 5 日
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
2021 年 2 月 6 日
Jan
2021 年 2 月 6 日
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.
回答 (0 件)
カテゴリ
ヘルプ センター および 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!