putting an equation as a code

12 Ansichten (letzte 30 Tage)
sasso samer
sasso samer am 9 Jul. 2016
Kommentiert: Image Analyst am 10 Jul. 2016
Can someone please help in writing this as a code? You will find the equation attached.

Antworten (1)

Image Analyst
Image Analyst am 9 Jul. 2016
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 Kommentare
sasso samer
sasso samer am 9 Jul. 2016
I attached another file other than the first one. So can you please recheck it?
Image Analyst
Image Analyst am 10 Jul. 2016
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by