MATLAB Answers

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

3 views (last 30 days)
nihed sboui
nihed sboui on 5 Mar 2020
Answered: ME on 5 Mar 2020

  0 Comments

Sign in to comment.

Answers (2)

Ajay Kumar
Ajay Kumar on 5 Mar 2020
Edited: Ajay Kumar on 5 Mar 2020
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

  0 Comments

Sign in to comment.


ME
ME on 5 Mar 2020
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

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags