How to perform Double Sum with the help of loops?

3 Ansichten (letzte 30 Tage)
Mihir Rathod
Mihir Rathod am 18 Okt. 2021
Bearbeitet: Cris LaPierre am 18 Okt. 2021
I have a following question, which is to be solved with loops : i+j, where m = 1, n = 12, o = 3, p = 7 and i+j = 3 is.

Antworten (1)

Cris LaPierre
Cris LaPierre am 18 Okt. 2021
Bearbeitet: Cris LaPierre am 18 Okt. 2021
See the nested for loop example on the for documentation page.
BTW, if i+j=3, then there is no double summing necessary, right? You already know the result.
Instead, the value of i is incrementing from m to n, and the value of j is incrementing from o to p, and i+j is the operation to be calculated for all values of i and j.

Kategorien

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

Tags

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by