Issue with 2D Planar Area Calculation Using surf

2 ビュー (過去 30 日間)
peter huang
peter huang 2025 年 7 月 24 日
編集済み: Matt J 2025 年 7 月 24 日
Hello MATLAB community,
I would like to ask how to calculate the area of a colored region from a surf plot.
For example, in the figure I’m working with, I want to determine the concentration area where the value is greater than 0.2.
My current idea is to extract the outer boundary of that region and use polyarea to calculate the area.
However, the boundary function in MATLAB doesn't seem to work properly in this context.
Below is the code I’m currently working with.
Any help or suggestions would be greatly appreciated.
Thank you very much for your support!
  1 件のコメント
KSSV
KSSV 2025 年 7 月 24 日
The range of your max_Layer1 data is [0 0.0040]. There are no values > 0.2.

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

回答 (1 件)

Matt J
Matt J 2025 年 7 月 24 日
編集済み: Matt J 2025 年 7 月 24 日
You may havee to regrid the data so that it is uniformly spaced and also scale the area calculation by the pixel area:
load max_Layer1.mat
BW=281000<=GX&GX<=293000&...
2780000<=GY&GY<=2790000&...
2e-4 <=max_Layer1&max_Layer1<=15*10^-4;
area=bwarea(BW),
area = 1.2016e+03
imshow(BW',[])

カテゴリ

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