How can I calculate the areas between these two curves?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I need to calculate both areas A and B that lie between these two curves. The curves are extracted form two text files, which are attatched. The code below shows how the graph is produced.
close all
clearvars
DM = readtable('FF677-Di01.txt');
plot (DM{:,1},DM{:,2})
hold on
AF = readtable('Alexa Fluor 647 - Em.txt');
plot (AF{:,1},AF{:,2})
A = intersect(DM{:,1}, AF{:,1});
xlim ([500 900])
hold on
AArea = trapz(AF{:,1},AF{:,2});
DMArea = trapz(DM{:,1},DM{:,2});
0 Commenti
Risposte (1)
Dinesh Yadav
il 22 Lug 2020
To calculate the area B change the follwing line of code
AArea = trapz(AF{:,1},AF{:,2});
to
AArea = abs(trapz(AF{:,1},(AF{:,2} - DM{:,2} )));
and to compute area A calculate the area under the AF and subtract AArea from it
DMArea = abs(trapz(AF1{:,1},AF{:,2} - AArea);
Vedere anche
Categorie
Scopri di più su Bar Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!