For Loop - Homework Question
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Nathan Brannan
am 11 Mär. 2021
Kommentiert: Nathan Brannan
am 11 Mär. 2021
I have a homework problem that I've been working on, but I've come to a section that I believe requires a for loop. The section that I'm dealing with is below.

The matlab code that I've tried is this:
n=0;
for n=i-1 && n<=40
income = initial_income*(1+inflation)^n
end
From my understanding, this will only find the value at n=0. I believe I need each value of income at n = 1:40.
Any and all help would be appreciated!
I'll place the rest of the problem below for the sake of context. The retirement year that I found was 1959, but I don't believe that will be relevant to this section.

Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
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!