how to find volume using integral

15 次查看(过去 30 天)
sharon
sharon 2015-1-6
编辑: Mike Hosea 2015-2-14
how to calculate volume using integral function from the given matrix of a,b,c coordinates

回答(1 个)

Mike Hosea
Mike Hosea 2015-2-14
编辑:Mike Hosea 2015-2-14
You can't do that with INTEGRAL. The integral functions are for integrating functions, not data. A set of coordinates in 3-D space does not have a volume, since points have no volume. I would guess that you mean, for example, the volume of a polyhedron defined by those vertices or some such. That's just a guess. If that is what you mean, you might want to ask "How do I find the volume of a polyhedron in MATLAB given a matrix of vertex points?"
Now to answer the question of the title of how to find volume using INTEGRAL, here is an example that computes the volume of a sphere. Of course it's fairly dumb to compute the area of a sphere this way, but the point of the example is to illustrate the use of functions to define the region of interest. It should be clear how to modify it for other regions that can be described as being bounded by a <= x <= b, c(x) <= y <= d(x), e(x,y) <= z <= f(x,y).
a = -1;
b = 1;
c = @(x)-sqrt(1 - x.^2);
d = @(x)sqrt(1 - x.^2);
e = @(x,y)-sqrt(1 - x.^2 - y.^2);
f = @(x,y)sqrt(1 - x.^2 - y.^2);
volume = integral3(@(x,y,z)ones(size(x)),a,b,c,d,e,f)

类别

Help CenterFile Exchange 中查找有关 Volume Visualization 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by