Info
此问题已关闭。 请重新打开它进行编辑或回答。
Writing a for loop to perform an operation on a vector
1 次查看(过去 30 天)
显示 更早的评论
I have a vector x = [4,2,6,5,3,8,2], where n (number of elements) = 7. I want to write a function
f = (1+x1)^n1 + (1+x2)^n2 + (1+x3)^n3 + (1+x4)^n4 + (1+x5)^n5 + (1+x6)^n6.
Please note that I do not want the last element (x7) in this expression. How do I write a for loop for this.
I am new to MATLAB and any help would be appreciated. Thanks!
0 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!