Effacer les filtres
Effacer les filtres

How are the levels for the lines in the contour() function choosen

1 vue (au cours des 30 derniers jours)
cbrysch
cbrysch le 18 Août 2016
Réponse apportée : cbrysch le 19 Août 2016
I am using the contour function to analyze my data (2D matrix). For that I want to draw one contour line using the contour function with
Contourline=contour(MyData,1);
However, I am wondering now what exactly this contour line represents, meaning what is the algorithm that specifies where this contour line is drawn. The documentation only says that the contour levels are chosen automatically but not exactly how.

Réponse acceptée

cbrysch
cbrysch le 19 Août 2016
I was also asking this Question on Stack.Overflow where it got answered by Suever:
As far as how MATLAB selects the levels when you specify the number of levels, it creates equally spaced levels between the minimum and maximum of the input data using the following formula:
minimum = min(real(double(data(:)));
maximum = max(real(double(data(:)));
tmp = linspace(minimum, maximum, nLevels + 2);
levels = tmp(2:end-1);

Plus de réponses (0)

Catégories

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

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by