필터 지우기
필터 지우기

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

조회 수: 52 (최근 30일)
Belal Abboushi
Belal Abboushi 2015년 1월 21일
댓글: Image Analyst 2015년 1월 21일
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
  댓글 수: 1
Image Analyst
Image Analyst 2015년 1월 21일
Belal's "Answer" moved here:
You saved my life! Thanks a lot

댓글을 달려면 로그인하십시오.

추가 답변 (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