How can I bring up custom documentation html files directly from the command line via the doc command?
1 次查看(过去 30 天)
显示 更早的评论
MathWorks Support Team
2017-11-20
回答: MathWorks Support Team
2017-12-18
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.
采纳的回答
MathWorks Support Team
2019-7-18
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
0 个评论
更多回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!