Use of integrate without explicit function - defined by variable

Dear All,
I would like to integrate something which is not defined by a function (anoymous or otherwise. The 'function' is defined by a set of values iod a varable (y) at a number of points defined in another variable (x). I want to integate y with respect to x.
Is there some way of doing this? Graphically I could plot y against x and find the area under the graph. Is this the way I ahould do it using Matalb or is there something more sophisticated?
All help will be welcome.
John

回答(1 个)

doc cumtrapz

3 个评论

Dear Madhan,
That is great. Many, many thanks.
After posting this question, I discovered trapz. Is cumtrapz different?
John
Dear Madhan, I think I understand, but trapz does perfectly what I want. Thanks.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Numerical Integration and Differentiation 的更多信息

产品

版本

R2019b

提问:

2020-6-15

评论:

2020-6-15

Community Treasure Hunt

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

Start Hunting!

Translated by