How do I generate links in documentation?

6 Ansichten (letzte 30 Tage)
Tilo Arens
Tilo Arens am 21 Dez. 2016
Bearbeitet: Soumya Saxena am 30 Dez. 2016
The Matlab documentation describes how links to properties, methods or event documentation are generated automatically in specific places of the documentation. Is it also possible to generate a link to another class if it is mentioned in the help text?

Antworten (1)

Soumya Saxena
Soumya Saxena am 29 Dez. 2016
Bearbeitet: Soumya Saxena am 30 Dez. 2016
I understand that you want to know how you can generate links to the help text for another class from a class. It is possible to use "See also" keyword to create such links.
"See also" creates links by including function or class names at the end of the help text on a line that begins with % See also. If the function or class exists on the search path or in the current folder, the help command displays each of these names as a hyperlink to its help.
For instance, if you have 2 classes, named myClass and myClass2, you may create link to myClass2 from myClass by using %See also. The following is an example:
classdef myClass
% myClass Summary of myClass
% This is the first line of the description of myClass.
% Descriptions can include multiple lines of text.
%
% See also myClass2
%
% myClass Properties:
% a - Description of a
% b - Description of b
%
% myClass Methods:
% doThis - Description of doThis
% doThat - Description of doThat
properties
a
b
end
methods
function obj = myClass
end
function doThis(obj)
end
function doThat(obj)
end
end
end
When you give the command, doc myClass or help myClass, the help for myClass will be visible along with the link to the documentation for myClass2.

Kategorien

Mehr zu Live Scripts and Functions finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by