Contour2Area

バージョン 1.0.0.0 (2.03 KB) 作成者: Per Sundqvist
Gives the area of polygons from the matlab function C=contour(x,y,z) and their centroids.
ダウンロード: 2.2K
更新 2010/1/26

ライセンスの表示

Gives the area of the polygons that are created from the matlab function C=contour(x,y,z,...); It also gives the centroids (centre of mass) of each polygon. The structure of C delivered by contour is a bit complicated to work with itself, why I developed this matlab function.

Syntax: [Area,Centroid,IN]=Contour2Area(C)
Takes the contour argument C from matlabs function contourc
as produced by C=contour(x,y,z,...) and convert the contours
to closed polygons from where the areas are calculated.
In addition the centroids (centre of mass) Cxy are calculated
and a matrix IN determining the parent/child relationship
between the contours (if polygon i is inside j then IN_ij=1, else=0).
For obscure contours NaN would be retrived, but are excluded in output.
%
Created By: Per Sundqvist 2010-01-26, ABB/CRC, Västerås/Sweden.
%
%--- Example ---
[X,Y,Z] = PEAKS(50);
figure(1), clf;
%C=contourf(X,Y,Z,0.37+[0 0]);
C=contourf(X,Y,Z,5);
[Area,Centroid,IN]=Contour2Area(C);
xc=Centroid(1,:);yc=Centroid(2,:);
hold on;plot(xc,yc,'k*');
Area
IN

引用

Per Sundqvist (2025). Contour2Area (https://jp.mathworks.com/matlabcentral/fileexchange/26480-contour2area), MATLAB Central File Exchange. に取得済み.

MATLAB リリースの互換性
作成: R2008b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersContour Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0