How can I create a for loop that takes the number 500 and multiplies it by 1.1 every 7 steps (7,14,21,...), meaning that i want the answer as follows: 500.... 500*1.1....500*1.1*1.1....500*1.1*1.1*1.1 etc
1 次查看(过去 30 天)
显示 更早的评论
How can I create a for loop that takes the number 500 and multiplies it by 1.1 every 7 steps (7,14,21,...), meaning that i want the answer as follows: 500.... 500*1.1....500*1.1*1.1....500*1.1*1.1*1.1 etc
0 个评论
采纳的回答
更多回答(1 个)
Fake Name Johnson
2021-5-15
Here's a start
a = 500;
k = 1.1;
p = 0:5;
s = 7;
x = a*k.^p;
x = repelem(x,s)
just adjust p as needed to get the desired length.
5 个评论
另请参阅
类别
在 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!