MATLAB: Do I receive incorrect results when using CONTOURF function in MATLAB 7.1 (R14SP3)

contourcontourfMATLAB

When I use the CONTOURF function in MATLAB 7.1 the contour plot generated is incorrect. The function also takes very long to run and produce results. The generated figure file is much larger as compared to that generated from previous versions. I did not observe this behavior in previous versions of MATLAB.

Best Answer

This bug has been fixed in Release 2006a (R2006a). For previous product releases, read below for any possible workarounds:
There is a bug in MATLAB 7.1 (R14SP3) the way CONTOURF function handles user inputs.
The symptoms are observed when the X and Y inputs are transposed. To work around the issue, transpose the inputs before passing them to the CONTOURF function. For example:
contourf(X', Y', p', 15); % Instead of contourf(X, Y, p, 15)
Alternatively, the CONTOURF behavior for MATLAB version 6 can be invoked by using the following form of the function call
contourf('v6', X, Y, p, 15);
Note that using 'v6' will create a set of patches instead of a CONTOURGROUP object.