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

1 次查看(过去 30 天)
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.

采纳的回答

cbrysch
cbrysch 2016-8-19
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Contour Plots 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by