Can someone please help in writing this as a code? You will find the equation attached.

답변 (1개)

Image Analyst
Image Analyst 2016년 7월 9일

0 개 추천

If Z is the size of the first dimension, then:
theSum = sum(M(:, y) .* S(:, y) ./ (1 + K(:, y)));
because ":" (the colon operator) means "all rows". Otherwise, if Z is not the last element in the first dimension:
theSum = sum(M(1:Z, y) .* S(1:Z, y) ./ (1 + K(1:Z, y)));

댓글 수: 6

sasso samer
sasso samer 2016년 7월 9일
I don't understand the difference between the two lines
Image Analyst
Image Analyst 2016년 7월 9일
One only considers rows 1 through Z while the first considers all lines. For example if your arrays have 40 rows, and Z = 10, then the first code uses all 40 rows, while the second line of code uses only 10 rows of the arrays.
It's reasonable, though not 100% certain, to assume that Z is the total number of rows in each of the arrays.
sasso samer
sasso samer 2016년 7월 9일
sorry i put the wrong PDF Can you please recheck it?
Image Analyst
Image Analyst 2016년 7월 9일
How?
sasso samer
sasso samer 2016년 7월 9일
I attached another file other than the first one. So can you please recheck it?
Image Analyst
Image Analyst 2016년 7월 10일
Just make the subscripts like indexes, so M sub z,j is M(z, j). Then take it just one term at a time, like numerator = M*...... etc. You should be able to do it, it's easy especially after I just told you how to turn subscripts into indexes.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2016년 7월 9일

댓글:

2016년 7월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by