How to get back the values of a curve from its cumulative integral value?
1 回表示 (過去 30 日間)
古いコメントを表示
I have a amplitude distribution with time ( i.e. real curve, blak line). Then I did cumulative trapezoidal inegration of the curve using cumtrapz, which is represented by blue curve. Now, I again retain the real curve i.e. black curve from its cumulative integration i.e. blue curve. How I will get the real curve? Please provide me the suggestions. Thanks in advance.
0 件のコメント
採用された回答
darova
2021 年 4 月 5 日
Use diff to find real curve from cumulative trapezoid result
6 件のコメント
darova
2021 年 4 月 7 日
Works ok for me
clc,clear
y = load('data.txt');
x = 1:length(y);
inty = cumtrapz(x,y);
y1 = diff(inty)./diff(x);
plot(x,y,'r')
line(x,inty,'color','k','linestyle','--')
line(x(2:end),y1)
legend('original','returned')
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!