Finding area/volume under a 3d plot

5 views (last 30 days)
Vasiliy Safin
Vasiliy Safin on 11 Jul 2018
Hello,
I have some data that can be looked at in 2d and in 3d. In 2d, it's typical to look at the area under the plotted "curve" and I can easily do that using the trapz function. For example, if my plot is x = [1 2 3] and y = [10 20 30] then trapz(x,y) correctly gives me the area under the plotted line as 40. However, let's say I also have a dimension Z = [10 10 10], then, I would think integrating that space under the plot should result in something like 400? (my math could be wrong).
Currently, my data is in the format that has 3 rows and 25 columns (5 values for X by 5 values for Y) : [0 0 0 0 0 1 1 1 1 1... 5 5 5 5 5; 1 1 1 1 1 2 2 2 2 ... 10 10 10 10 10; 200 150 120 80 10... 40 30 20 10 0]
I have looked through various questions that seem similar to this, but couldn't quite get the solutions to work for me. For instance, I think this is probably the right direction, but I am still stuck: I think this post is related: https://blogs.mathworks.com/loren/2011/06/13/calculating-the-area-under-a-surface/#1
In short, I'm trying to find some empirical way to demonstrate if the area/surface under one plot is smaller than under another plot, and perhaps (eventually) if the plot slopes down as x and y increase. I am sure there are other ways to describe the data, but there is already an established "area under the curve" measure for 2d plots, and I wonder if it could be sensible to have an analogous measure for 3d plots.
Thank you!!

Answers (0)

Community Treasure Hunt

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

Start Hunting!