Is there a way to find the lengths of the contours in fcontour or other?

11 ビュー (過去 30 日間)
David Gillcrist
David Gillcrist 2024 年 11 月 18 日 17:07
回答済み: Walter Roberson 2024 年 11 月 18 日 17:21
I have a 2D polynomial function of which I am trying to determine the approximate lengths of its level curves/isolines/contours. I know that MATLAB can easily plot these level curves, via the fcontour plot, but I what I need more than a plot itself is the total length of each contour within the domain of the plot. At a cursory glance, there does not appear to be a property of fcontour that gives these length. Is there some way to extract these or do I have to go about writing my own algorithm to get them. Any help or guidance would be greatly appreciated.

回答 (1 件)

Walter Roberson
Walter Roberson 2024 年 11 月 18 日 17:21
You can request the ContourMatrix property of the FunctionContour object returned by fcontour . The ContourMatrix contains information about each contour. You can decode the contour matrix and calculate the length of each perimeter .
A more convenient way of dealing with contour matrix data is to use https://www.mathworks.com/matlabcentral/fileexchange/38863-extract-contour-data-from-contour-matrix-c

カテゴリ

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

タグ

製品


リリース

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by