calculat the percentage of the red curve in the blue one?

조회 수: 2 (최근 30일)
nihed sboui
nihed sboui 2020년 3월 5일
답변: ME 2020년 3월 5일

답변 (2개)

Ajay Kumar
Ajay Kumar 2020년 3월 5일
편집: Ajay Kumar 2020년 3월 5일
Do you mean exactly same values in red and blue lines? You can do:
same_values = find(blueline==redline); % gives same samples
percentage_of_red_in_blue = (100*numel(same_values))/numel(blueline); % gives percentage of red in blue

ME
ME 2020년 3월 5일
do you mean the ratio of the volumes under the lines? You can easily calculate it with
percentage_of_red_in_blue = 100 * sum(red) / sum(blue);
if both curves have the same discretised x-values

카테고리

Help CenterFile Exchange에서 Particle & Nuclear Physics에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by