Effacer les filtres
Effacer les filtres

AREA UNDER CURVE (TRAPZ)

2 vues (au cours des 30 derniers jours)
Sasuka Teo
Sasuka Teo le 26 Jan 2016
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 ?
  1 commentaire
Sasuka Teo
Sasuka Teo le 26 Jan 2016

Connectez-vous pour commenter.

Réponses (2)

Matt J
Matt J le 26 Jan 2016
Modifié(e) : Matt J le 26 Jan 2016
trapz(x,y1) - trapz(x,y2)
or
trapz(x,y3)
where y3=sin(x)-3.

Siranjeevi Gurumani
Siranjeevi Gurumani le 23 Oct 2021
Modifié(e) : Siranjeevi Gurumani le 23 Oct 2021
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)

Catégories

En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by