Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
create documentation file for user-defined classes

Subject: create documentation file for user-defined classes

From: MM

Date: 4 Mar, 2009 09:40:03

Message: 1 of 5

Hello,

       I was wondering if someone could tell me how someone could create a user documentation (like Help file) for his own class. Is there any book that suggests it?

thanks,
MM

Subject: create documentation file for user-defined classes

From: Daniel Armyr

Date: 4 Mar, 2009 10:07:01

Message: 2 of 5

Well, you do it the same way as you do with your own functions. The comments at the top of the classdef file is your help-file.

Here is a sample

classdef HelloWorld
% HelloWorld is a class that prints Hello World! to the console
<Write the actual class here>


When you have saved the file you can type:
>>help HelloWorld
and get:
HelloWorld is a class that prints Hello World! to the console

Subject: create documentation file for user-defined classes

From: MM

Date: 4 Mar, 2009 11:43:01

Message: 3 of 5

Hi Daryl,

Thanks for the answer. I was actually referring to the help file that MATLAB has..the one that you get by typing ">>doc fft " for example, for the FFT function documentation. Can you tell me how to get that sort of documentation?

Thanks

-------------------------------------------
"MM " <manmedia@yahoo.com> wrote in message <goli9j$7jt$1@fred.mathworks.com>...
> Hello,
>
> I was wondering if someone could tell me how someone could create a user documentation (like Help file) for his own class. Is there any book that suggests it?
>
> thanks,
> MM

Subject: create documentation file for user-defined classes

From: Daniel Armyr

Date: 4 Mar, 2009 15:00:19

Message: 4 of 5

Well, that works too.
Type:
>>doc <function>
Where <function> is any function on the path and Matlab will format your help text into a nice html-page.

Subject: create documentation file for user-defined classes

From: Eric

Date: 4 Mar, 2009 15:56:02

Message: 5 of 5

See the documentation here for an example of how to write comments in your class that will get picked up by the DOC command and formatted into a nice HTML file:

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/bruby4n-1.html#brubz7_-1

If you just want to see an example of how it will look, try these commands one at a time:

% Change the current directory to where the example file is located.
cd(fullfile(matlabroot,'help','techdoc','matlab_env', 'examples'))
% View help for the file in the Help browser.
doc sads
% For more information, follow links. Or go directly to help, e.g. for the steer method.
doc sads.steer

"MM " <manmedia@yahoo.com> wrote in message <golpg5$r19$1@fred.mathworks.com>...
> Hi Daryl,
>
> Thanks for the answer. I was actually referring to the help file that MATLAB has..the one that you get by typing ">>doc fft " for example, for the FFT function documentation. Can you tell me how to get that sort of documentation?
>
> Thanks
>
> -------------------------------------------
> "MM " <manmedia@yahoo.com> wrote in message <goli9j$7jt$1@fred.mathworks.com>...
> > Hello,
> >
> > I was wondering if someone could tell me how someone could create a user documentation (like Help file) for his own class. Is there any book that suggests it?
> >
> > thanks,
> > MM

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us