How can i add all the points between two data cursor points

Hello, i wish to add all points between two data cursor or get all the points to an array For instance in the picture below, i wish to add all the points between the two cursor together, i mean the y axis.

回答(1 个)

Using the sum (link) function on the appropriate vector should work. If you have limits on the array elements you want to include, use the find (link) function to determine the closest index values to the values you want.

2 个评论

am getting a wrong answer
>> sum(U2354A6(4780:4860))
ans =
0.0040
the result is not correct. That's the problem am having now
Assuming the indices are correct, and you’re using the data you plotted in your sum call, I can’t tell what the problem may be from the information you’ve provided.
I’ll delete my Answer in a few hours.

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by