필터 지우기
필터 지우기

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

조회 수: 2 (최근 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 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