How can I create a for loop that takes the number 12000
1 次查看(过去 30 天)
显示 更早的评论
How can I create a for loop that takes the number 12000 (Annual salary) and multiplies it by 1.1( increase every 7 years) every 7 years (7,14,21,...), meaning that i want the answer as follows: 12000*(1+n).... 12000*1.1*(1+n)....12000*1.1*1.1*(1+n)....12000*1.1*1.1*1.1*(1+n) etc knowing that n is the years (7,14,21,....)
0 个评论
采纳的回答
Image Analyst
2021-5-15
编辑:Image Analyst
2021-5-15
salary = 12000
for n = 7 : 7 : 63
salary = salary * 1.1
end
Note : since you're only multiplying by 1.1 every 7th year, it should not be called an "annual increase" since it does not increase annually. It increases only every 7th year.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 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!