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

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

采纳的回答

Shashank Prasanna
Shashank Prasanna 2013-1-20
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
  4 个评论
Shashank Prasanna
Shashank Prasanna 2013-1-20
Carlos, yes you are right you would lose all your paths if you ran that, but it would definitely fix issues if there were 3rd party toolbox conflicts. But I am glad it worked fine.
If you notice conflicts in the future, just run:
which -all filename
This will tell you all occurrences of that function, and you will be able to see where in the path they are stores so you can see if there is anything suspicious.
Image Analyst
Image Analyst 2013-1-20
This is what I have:
>> which -all message
message is a built-in method % message constructor
C:\Program Files\MATLAB\R2012b\toolbox\shared\filterdesignlib\@FilterDesignDialog\message.m % FilterDesignDialog method
C:\Program Files\MATLAB\R2012b\toolbox\shared\spcuilib\@uiservices\message.m % uiservices method
C:\Program Files\MATLAB\R2012b\toolbox\signal\sigtools\@siggui\message.m % siggui method
C:\Program Files\MATLAB\R2012b\toolbox\matlab\lang\message.m % Shadowed
And the example works fine for me - no complaint about message's output arguments. Let us know if you have another message m-file somewhere. It seems you must. If you don't see anything different than what I put, then search your hard drive for message.m to find the guilty "message" function culprit.

请先登录,再进行评论。

更多回答(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