Borrar filtros
Borrar filtros

How to normalize curves such that area under curve=1?

52 visualizaciones (últimos 30 días)
I'm trying to plot three curves such that area under curve =1. I've tried trapz but it only gives me the area and i couldn't change it.
Any idea?

Respuesta aceptada

Mohammad Abouali
Mohammad Abouali el 21 de En. de 2015
Editada: Mohammad Abouali el 21 de En. de 2015
divide all numbers by the area that you calculate using Trapz.
x=0:0.1:pi;
y=sin(x);
Area=trapz(x,y)
Area =
1.9975
y_normalized=y./Area;
trapz(x, y_normalized)
ans =
1.0000

Más respuestas (0)

Categorías

Más información sobre Numerical Integration and Differentiation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by