Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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.

Risposta accettata

cbrysch
cbrysch il 19 Ago 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);

Più risposte (0)

Categorie

Scopri di più su Contour Plots in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by