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

52 次查看(过去 30 天)
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?

采纳的回答

Mohammad Abouali
Mohammad Abouali 2015-1-21
编辑:Mohammad Abouali 2015-1-21
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

更多回答(0 个)

类别

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