Need to find the area between two functions

I've got the following code, Y is a numeric matrix. Using the trapz function I've been able to find the area under the curve. Is it possible to find the area under the curve above Y=0.8 and between X=-0.03 and 0.03. the graph is a bell shaped curve for reference
x = [1:9996];
y = [B1];
plot(x, y);
trapz(x,y)

3 comentarios

HighPhi
HighPhi el 10 de Feb. de 2022
what is your B1? I may be able to help you if I knew what was inside y.
Kano Lewis
Kano Lewis el 10 de Feb. de 2022
thank you for your help,
B1 is the data in my excel spreadsheet from b27 to b(27+9996)
Kano Lewis
Kano Lewis el 10 de Feb. de 2022
I imported it as a numerical matrix if this helps

Iniciar sesión para comentar.

 Respuesta aceptada

Cris LaPierre
Cris LaPierre el 10 de Feb. de 2022

0 votos

Find the area under each function separately, then subtract them.

Más respuestas (1)

yanqi liu
yanqi liu el 11 de Feb. de 2022
x = [1:9996];
y = [B1];
ind = y < 0.8;
x(ind) = [];
y(ind) = [];
plot(x, y);
trapz(x,y)

Categorías

Productos

Versión

R2021b

Preguntada:

el 10 de Feb. de 2022

Respondida:

el 11 de Feb. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by