MATLAB: Problems with contour function: it doesn’t work even matlab’s examples

contourMATLABplottingr2011b

I can't plot not one contour figure (matlab examples too). For example, when I typed:
>> [X,Y,Z] = peaks;
>> contour(X,Y,Z,20)
I obtained:
Error using message
Too many output arguments.
Error in contours (line 53) warning(message('MATLAB:contours:DeprecatedErrorOutputArgument', upper( mfilename )));
Error in specgraph.contourgroup/refresh (line 180) [this.contourmatrix,msg] = contours(x,y,z,levels);
Error in specgraph.contourgroup/schema>LdoDirtyAction (line 265) refresh(h);
I am working with Matlab R2011b in a Macbook pro. Thank you in advance for any help.
Carlos

Best Answer

Are you sure you are not using 'contours' instead of 'contour'. The error message you mentioned is part of 'contours.m' and not 'contour.m' as you show in your code. contours is undocumented not recommended for use.
If you feel there has been a path issue, I recommend you run:
>> restoredefaultpath
>> rehash toolboxcache
Related Question