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

11 vues (au cours des 30 derniers jours)
David Gillcrist
David Gillcrist le 18 Nov 2024 à 17:07
Réponse apportée : Walter Roberson le 18 Nov 2024 à 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.

Réponses (1)

Walter Roberson
Walter Roberson le 18 Nov 2024 à 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

Catégories

En savoir plus sur Contour Plots dans Help Center et File Exchange

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by