Why do CONTOUR and CONTOURC produce different results in MATLAB 7.8 (R2009a)?
4 次查看(过去 30 天)
显示 更早的评论
The CONTOURC documentation states that: "contourc calculates the contour matrix C used by contour, contour3, and contourf.". So I am wondering why the following code does not produce the same results for C1 and C2:
[C1,h] = contour(peaks)
C2 = contourc(peaks)
采纳的回答
MathWorks Support Team
2009-6-27
When using CONTOUR and CONTOURC the results C1 and C2 might indeed differ:
[C1,h] = contour(peaks)
C2 = contour(peaks)
However C1 and C2 are not necessarily expected to be exactly the same. As of MATLAB 7.4 (R2009a) the CONTOUR documentation provides the following explanation:
[C,h] = contour(...) returns a contour matrix, C, derived from the matrix returned by the low-level contourc function, and a handle, h, to a contourgroup object. clabel uses the contour matrix C to create the labels. (See descriptions of contourgroup properties.)
In this context "derived" indicates the matrices are not exactly the same, which is due to numerical precision as well as post-processing that occurs in CONTOUR. The same holds true for the sentence: "contourc calculates the contour matrix C used by contour".
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Contour Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!