How to calculate volume of surf plot (3d plot) en matlab?

20 ビュー (過去 30 日間)
abdelmadjid benrabah
abdelmadjid benrabah 2021 年 9 月 17 日
コメント済み: Star Strider 2021 年 9 月 17 日
How to calculate volume of surf plot (3d plot) en matlab?
using variable x and y and function z

採用された回答

Star Strider
Star Strider 2021 年 9 月 17 日
The surf plot arguments are matrices, so use trapz:
x = 1:10;
y = 1:20;
[X,Y] = meshgrid(x,y);
z = exp(-((X-5)/5.*(Y-10)/10).^2)
z = 20×10
0.5955 0.7471 0.8784 0.9681 1.0000 0.9681 0.8784 0.7471 0.5955 0.4449 0.6639 0.7942 0.9027 0.9747 1.0000 0.9747 0.9027 0.7942 0.6639 0.5273 0.7308 0.8383 0.9246 0.9806 1.0000 0.9806 0.9246 0.8383 0.7308 0.6126 0.7942 0.8784 0.9440 0.9857 1.0000 0.9857 0.9440 0.8784 0.7942 0.6977 0.8521 0.9139 0.9608 0.9900 1.0000 0.9900 0.9608 0.9139 0.8521 0.7788 0.9027 0.9440 0.9747 0.9936 1.0000 0.9936 0.9747 0.9440 0.9027 0.8521 0.9440 0.9681 0.9857 0.9964 1.0000 0.9964 0.9857 0.9681 0.9440 0.9139 0.9747 0.9857 0.9936 0.9984 1.0000 0.9984 0.9936 0.9857 0.9747 0.9608 0.9936 0.9964 0.9984 0.9996 1.0000 0.9996 0.9984 0.9964 0.9936 0.9900 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
zvol = trapz(x,trapz(y,z))
zvol = 158.0451
figure
surf(x, y, z)
grid on
.
  4 件のコメント
abdelmadjid benrabah
abdelmadjid benrabah 2021 年 9 月 17 日
okay, thnx again
Star Strider
Star Strider 2021 年 9 月 17 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differentiation についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by