フィルターのクリア

How to get the integral (function) from a vector?

3 ビュー (過去 30 日間)
carlos g
carlos g 2017 年 3 月 19 日
コメント済み: carlos g 2017 年 3 月 20 日
Dear all,
I have a vector than can be plotted and I would like to compute its integral. I don't mean the total area below, but how it evolves over the domain of integration. Basically, its "indefinite" integral. Is this possible? maybe via interpolation?
Thank you

回答 (2 件)

Star Strider
Star Strider 2017 年 3 月 19 日
I would use the cumtrapz function to integrate it. The last value is the value of the entire integral.
  1 件のコメント
Image Analyst
Image Analyst 2017 年 3 月 19 日
Or perhaps cumsum() depending on your philosophy of what integration means to you, or depending on the physics of the real world situation.

サインインしてコメントする。


Roger Stafford
Roger Stafford 2017 年 3 月 19 日
I wrote a function for the File Exchange which uses third order integration methods for discrete sets of points to obtain a cumulative integral, and is therefore usually more accurate than trapz or cumtrapz. It is located at:
http://www.mathworks.com/matlabcentral/fileexchange/19152-cumulative-cubic-integration .
  1 件のコメント
carlos g
carlos g 2017 年 3 月 20 日
Hi Roger,
It worked just perfectly, thanks a lot!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by