[英]How do I add documentation to a matlab package?
Say I have the following file structure: 说我有以下文件结构:
+mypackage/
foo.m
bar.m
How can I add help to the output of help(mypackage)
? 如何在
help(mypackage)
的输出中添加帮助?
In python, I'd just add a docstring in __init__.py
. 在python中,我只需在
__init__.py
添加一个docstring。 What's the equivalent here? 这相当于什么?
Per MATLAB's toolbox distribution documentation , the MATLAB analog to Python's __init__.py
docstring would be a help summary file . 根据MATLAB的工具箱分发文档 ,MATLAB类似于Python的
__init__.py
文档字符串将是一个帮助摘要文件 。
Using the above folder structure, we can add a contents.m
file to achieve the desired behavior: 使用上面的文件夹结构,我们可以添加
contents.m
文件来实现所需的行为:
+mypackage/
foo.m
bar.m
contents.m
Given a basic contents.m
file: 给出一个基本的
contents.m
文件:
% This is contents.m
% This package contains:
% bar - Bar things
% foo - Foo things
We achieve the following: 我们实现了以下目标:
>> help mypackage
This is contents.m
This package contains:
bar - Bar things
foo - Foo things
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.