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

5 ビュー (過去 30 日間)
Carlos G-M
Carlos G-M 2013 年 1 月 20 日
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 Center および File ExchangeContour Plots についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by