How do I get more info on class method?

I'm new to OOP. I can see how to get the list of methods from a class. But don't know how to get info on how to use the method. So two questions: 1) if a method has a helpfile how do I view it? 2) if no helpfile, how do I get info on how to use the method (what it does, what arguments it needs, etc)?

3 件のコメント

Image Analyst
Image Analyst 2012 年 12 月 18 日
What method? One you're going to write? Or one that some else wrote that you're planning on using?
Doug
Doug 2012 年 12 月 18 日
One that others wrote (even more specific, one that Matlab developed)
Doug
Doug 2012 年 12 月 18 日
But the question isn't for a particular class/method. It is a general question. What are the ways to get info about methods for any given class. Functions that MathWorks developed have help files. And one can see it by typing 'help function' or maybe even 'type function' to see what the function does and its arguments. How does one do that for class methods?

サインインしてコメントする。

 採用された回答

Daniel Shub
Daniel Shub 2012 年 12 月 18 日
編集済み: Daniel Shub 2012 年 12 月 19 日

0 投票

As an example to get help with the isplaying method of the MATLAB audioplayer class you would do
help audioplayer.isplaying
which can be generalized as
help class.method
EDIT
If you want the documentation you can do
doc audioplayer/isplaying
which can be generalized as
doc class/method
If you want to see the code, it is a little harder since the code can be located in two places. You should try
type @audioplayer/isplaying
and
type audioplayer

4 件のコメント

Doug
Doug 2012 年 12 月 18 日
Thanks, that is helpful in those cases where a helpfile was provided. What about those that don't have a helpfile. How can I see the code to see what is needed?
Image Analyst
Image Analyst 2012 年 12 月 18 日
For files without help provided, you can look at the source code if it is available, just like for any file. Put cursor in the function and hit control-D.
Doug
Doug 2012 年 12 月 18 日
For example, here is some sample code figure(1);ax=gca;plot(1:100,1:100);x=[50 1];y=[50 1]; scribepin=scribe.scribepin('parent',ax,'DataAxes',ax,'DataPosition',[x;y;[0 0]]');figPixelPos=scribepin.topixels; When I type 'scribepin.methods' I see the 'topixels' method, but help is of no use. How do I find out more about it? I can guess what it does, but that is insufficient.
Doug
Doug 2012 年 12 月 18 日
I wrote my last comment without seeing Image Analyst comment. Thanks you both Daniel and Image Analyst. I think my question has now been answered

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2012 年 12 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by