Getting sum of Elements of a Vector
1 次查看(过去 30 天)
显示 更早的评论
Hi, I am writing a code in which i have to take the sum of a defined range of elements of a Vector. For e.g From (1,3) to (1,5). Means the sum of the value at Column 3,4 and 5. I have used the command sum in the following way but its giving ambiguous answers. sum(A(1,3):A(1,5)) Can anyone please guide me how to perform this task? Also inform me what mistake I am doing so I may correct my understanding. Thanks a lot.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!