How to correct the drift in the plot after cumtrapz?I have a data which has certain values and when I run the cumtrapz there is a periodic drift.Can someone help in rectifying this

1 Ansicht (letzte 30 Tage)
How to correct the drift in the plot after cumtrapz?I have a data which has certain values and when I run the cumtrapz there is a periodic drift. k4=cumtrapz(k3); Here k3 is having values in a column and when I run the cumtrapz function it gives plot with upward drift.I want it in the same level.
  1 Kommentar
Are Mjaavatten
Are Mjaavatten am 10 Feb. 2016
If
k4=cumtrapz(k3)
k4(i) is the value of the area under the curve defined by k3(1:i). As long as the elements of k3 are positive this area will increase as i increases. Thus the curve of k4 should indeed have an upward trend if mean(k3) > 0. If you expect otherwise, maybe cumtrapz is not what you want.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Star Strider
Star Strider am 10 Feb. 2016
I don’t have ‘k3’, so I can’t comment specifically. However, remember that if you have a constant, integrating it will result in a line with an upward slope (if the constant is positive) or negative (if the constant is negative):
syms f(x)
f(x) = 2;
V = int(f, x)
V(x) =
2*x
Q.E.D.

Community Treasure Hunt

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

Start Hunting!

Translated by