row that increases more every element
1 次查看(过去 30 天)
显示 更早的评论
Hello,
I was wondering how I would make an array that increases more every element
for example:
given lets say n=randi([10 20], 1);
how would i have vect1 = 9, 16, 25, 36, ... n: so bascially increasing by +2 every element starting at 9
3 个评论
Walter Roberson
2022-5-20
Your example increases by 9 each time, not by 2?
Are you wanting to start with the fixed value 9 and use the random number to determine the number of terms??
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!