Density measurment using cumulative plots
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Zuzana Pániková
le 27 Fév 2022
Commenté : Zuzana Pániková
le 5 Mar 2022
I have two plots
plot(a,b)
hold on
plot(c,d)
and now i need do:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/908800/image.png)
0 commentaires
Réponse acceptée
Plus de réponses (3)
Zuzana Pániková
le 2 Mar 2022
1 commentaire
Image Analyst
le 2 Mar 2022
I don't know. What are the two mat files and the xlsx file in the zip file? Which is yRed, yBlue, and the x values?
Image Analyst
le 4 Mar 2022
One way is to simply sum the curves and subtract them.
area = abs(sum(d) - sum(b));
That assumes there are no negative values, the curves don't cross, and treats the values like a bar chart (bars with flat tops). If you want to treat them like quadilaterals (like bars but slanted tops), you can use trapz().
Voir également
Catégories
En savoir plus sur Numerical Integration and Differentiation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!