Finding the area under a semilogy plot with straight line segments
Afficher commentaires plus anciens
I am trying to find out the area under a plot, the x-axis of which is in linear scale and y-axis in log scale. A sample plot is attached. The data points are given below. Any suggestions?

(100,0.01),(200,1),(500,1),(1000,0.5),(2000,0.5)
Réponses (1)
David Goodmanson
le 10 Juin 2018
Hi Arun,
You have four intervals, each defined by start and end points (x1,y1) and (x2,y2). In each interval, y is of the form y = C*exp(a*x) for some C and a, and the integral is
I = (x2-x1)*(y2-y1)/(log(y2)-log(y1))
where the logs are natural log. If you would rather use log10, then
I = (x2-x1)*(y2-y1)*log10(exp(1))/(log10(y2)-log10(y1)) .
In the two intervals where y = const, then these expressions collapse into the obvious result
I = (x2-x1)*y2
and of course the final result is the sum for all four intervals.
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!