How can I bring up custom documentation html files directly from the command line via the doc command?

1 view (last 30 days)
I have created custom documentation files.
Now, how can I implement the following behavior:
Typing
>>doc my_function
should display the custom function's documentation html file I created.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 18 Jul 2019
You cannot use the DOC function to open custom html documentation files from the MATLAB command line.
There are two workarounds:
1. Use the MATLAB command below:
>>docsearch my_function
This will bring up a hit in the documentation center with a link to your page.
2. Use the "web" function, as shown below:
>> web('absolute_path_to_the_file\my_function.html')
You would have to know the full path to the html file in this case. It may be helpful in this case to wrap the call to "web" in a function that indexes the documentation to the toolbox. As an example, see the function below:
function toolbox_doc(fun_name)
switch fun_name
case <fun_one>
web('path/to/fun_one.html');
case <fun_two>
web('path/to/fun_two.html');
end
end

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!