필터 지우기
필터 지우기

AREA UNDER CURVE (TRAPZ)

조회 수: 8 (최근 30일)
Sasuka Teo
Sasuka Teo 2016년 1월 26일
편집: Siranjeevi Gurumani 2021년 10월 23일
LET SAY MY DATA LIKE PICTURE ATTACHED. HOW CAN I CALCULATE THE AREA UNDER CURVE UNTIL BASELINE. FOR EXAMPLE:
y1=sin(x)
baseline=y2=3
how do i use trapz? trapz(x,y1) and ?

답변 (2개)

Matt J
Matt J 2016년 1월 26일
편집: Matt J 2016년 1월 26일
trapz(x,y1) - trapz(x,y2)
or
trapz(x,y3)
where y3=sin(x)-3.

Siranjeevi Gurumani
Siranjeevi Gurumani 2021년 10월 23일
편집: Siranjeevi Gurumani 2021년 10월 23일
x = 0:0.1:2*pi;
y1 = sin(x);
y2 = 0.5;%range of sinx between [-1,1]
z = y1 - y2;
z(z<0) = 0;
Area_above_threshold = trapz(x,z)

카테고리

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