how to find volume using integral
17 ビュー (過去 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 で Volume Visualization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!