フィルターのクリア

How to calculate the area between X-Axis, Y-Axis and the (60) contour line?

1 回表示 (過去 30 日間)
ly
ly 2024 年 1 月 24 日
編集済み: Matt J 2024 年 1 月 24 日
How to calculate the area between X-Axis, Y-Axis and the (60) contour line?
Code of the contour line:
x = 1:0.2:2;
y = 1:0.2:3;
[X,Y] = meshgrid(x,y);
Z = 1000*(X.*exp(-X.^2-Y.^2));
contour(X,Y,Z,[20 60 80],'ShowText','on')

採用された回答

Matt J
Matt J 2024 年 1 月 24 日
編集済み: Matt J 2024 年 1 月 24 日
Using this FEX download,
x = 1:0.2:2;
y = 1:0.2:3;
[X,Y] = meshgrid(x,y);
Z = 1000*(X.*exp(-X.^2-Y.^2));
cm=contour(X,Y,Z,[20 60 80],'ShowText','on');
[~, V]=getContourLineCoordinates(cm);
p=polyshape([1,1; V{2}]);
hold on;
plot(p);
hold off
Area=area(p)
Area = 0.1006

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by