How can I Integrate on an array with respect to another array

51 ビュー (過去 30 日間)
Aman Kumar
Aman Kumar 2024 年 3 月 26 日
コメント済み: Aman Kumar 2024 年 3 月 26 日
I want to integrate an array which is, acceleration, with respect to another array, which is time to get velocity, then integrate the velocity array with respect to time again to position. Does anyone know how I can do this? Any help will be appreciated thanks.

採用された回答

Steven Lord
Steven Lord 2024 年 3 月 26 日
To integrate data sets use the trapz or cumtrapz functions.
If you had functions to integrate use the integral family of functions.
  5 件のコメント
Steven Lord
Steven Lord 2024 年 3 月 26 日
When I say "data sets" and "functions" I mean variables and function handles.
Integrating data:
x = 1:10;
y = x.^2;
integrateDataSet1 = trapz(x, y)
integrateDataSet1 = 334.5000
integrateDataSet2 = cumtrapz(x, y)
integrateDataSet2 = 1x10
0 2.5000 9.0000 21.5000 42.0000 72.5000 115.0000 171.5000 244.0000 334.5000
Integrating functions:
f = @(x) x.^2;
integrateFunction = integral(f, 1, 10)
integrateFunction = 333
Aman Kumar
Aman Kumar 2024 年 3 月 26 日
Thank you for the help

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

その他の回答 (0 件)

カテゴリ

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