AREA UNDER CURVE (TRAPZ)
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 ?
Respuestas (2)
Siranjeevi Gurumani
el 23 de Oct. de 2021
Editada: Siranjeevi Gurumani
el 23 de Oct. de 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)
0 comentarios
Ver también
Categorías
Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!