简体   繁体   English

如何将文档添加到matlab包中?

[英]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.

相关问题 如何从Matlab中的超类继承文档? - How do I inherit documentation from super classes in Matlab? 如何在MATLAB中向框架添加图像? - How do I add an image to a frame in MATLAB? 如何在 MATLAB 编译的应用程序中包含相机支持包? - How do I include a camera support package in a MATLAB compiled application? 如何在matlab包中使用静态工厂方法? - How do I use static factory method in matlab package? 如何将MATLAB的inputParser与可选的字符串输入一起使用?文档说“使用验证功能”,但目前还不清楚如何做到这一点 - How do I use MATLAB's inputParser with optional string inputs? The documentation says “use a validation function” but it's unclear how to do that 如何称量图像然后在MATLAB中有效地添加它们? - How do I weigh images and then add them up efficiently in MATLAB? 如何在我的MATLAB图形中添加2个Y轴? - How do I add 2 Y axis to my MATLAB Plot? 如何在MATLAB中将MathWorks徽标添加到图像? - How do I add the MathWorks logo to an image in MATLAB? 如何向MATLAB数组递归添加维? - How do I recursively add dimensions to MATLAB array? 如何在Matlab中为神经网络添加一层? - How do I add a layer to a neural network in Matlab?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM