Write a function that takes as input a vector x and uses a for loop to calculate the sum of the vector x. It should output the sum of the vector.
2 次查看(过去 30 天)
显示 更早的评论
I have no idea what to do and I'm not allowed to use built-in matlab functions
2 个评论
Stephen23
2020-2-7
Start by doing these tutorials:
Most of what you need to know is contained in them.
回答(1 个)
royed
2020-2-7
In principle I shouldn't answer the question.
1) Define Array
2) for loop indexing the elements of the array till ir reaches the last element
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!