필터 지우기
필터 지우기

Calculating an area under a curve

조회 수: 3 (최근 30일)
Rengin
Rengin 2019년 3월 13일
댓글: Torsten 2019년 3월 13일
% Dear users,
% Is there any way to calculate an area under a curve as in the figure?
% It would really appreciate if you can help me.
% Thanks in advance!
Area Calculation Matlab.jpg
  댓글 수: 7
Rengin
Rengin 2019년 3월 13일
Dear Torsten,
You answered my question regarding the area under the curve. You suggested me the apply the equations below:
idx = t>0.2 ;
tp = t(idx );
up = u(idx );
area = trapz(tp,up)
I wonder if the calculated area is limited by the bottom dashed line or it also includes beyond this dashed line. I don't want to include the area from origin on but from P(0.2,187).
Thanks in advance!
Torsten
Torsten 2019년 3월 13일
The formula is gives an approximation for
integral_{t=0.2}^{t=t(end)} u(t) dt.
It seems that you want the area start at u=0.2.
Then subtract the area of the rectangle between u=0 and u=0.2 for 0.2 <= t <= t(end), i.e.
area = trapz(tp,up) - (tp(end)-0.2)*0.2

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by