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

조회 수: 5 (최근 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