how to find volume using integral
18 次查看(过去 30 天)
显示 更早的评论
how to calculate volume using integral function from the given matrix of a,b,c coordinates
0 个评论
回答(1 个)
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)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 3-D Volumetric Image Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!