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

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by