Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
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.

Respuesta aceptada

cbrysch
cbrysch el 19 de Ag. de 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);

Más respuestas (0)

Categorías

Más información sobre Contour Plots en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by