필터 지우기
필터 지우기

dealing with the offset - cumtrapz

조회 수: 5 (최근 30일)
Bran
Bran 2015년 1월 23일
답변: Christian R. 2019년 2월 20일
I am using cumtrapz which requires an equally spaced dataset in order to carry out integration. I pick the value closet to zero in order to begin my integration however I was wondering how do I correct for the slight offset so that my integration avoids accumulating error. I tried interpolation but it didnt fit with cumtrapz very neatly.

답변 (2개)

Matt J
Matt J 2015년 1월 23일
I am using cumtrapz which requires an equally spaced dataset in order to carry out integration.
Not sure what you mean by that. CUMTRAPZ supports the syntax
Z = cumtrapz(X,Y)
which allows you to specify non-uniformly spaced X.

Christian R.
Christian R. 2019년 2월 20일
In an integration if the steps are close enough the error will decrease, then, you must decrease the step of the vector the smaller the better but the slower it runs because of more points to compute. (try 1e-4 it might work).

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by