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

标签 matlab namespaces documentation

假设我有以下文件结构:

+mypackage/
  foo.m
  bar.m

如何向 help(mypackage) 的输出添加帮助?

在 python 中,我只是在 __init__.py 中添加一个文档字符串。这里的等价物是什么?

最佳答案

根据 MA​​TLAB 的 toolbox distribution documentation ,类似于 Python 的 __init__.py 文档字符串的 MATLAB 将是一个 help summary file .

使用上面的文件夹结构,我们可以添加一个 contents.m 文件来实现所需的行为:

+mypackage/
  foo.m
  bar.m
  contents.m

给定一个基本的 contents.m 文件:

% This is contents.m
% This package contains:
%     bar - Bar things
%     foo - Foo things

我们实现了以下目标:

>> help mypackage
  This is contents.m
  This package contains:
      bar - Bar things
      foo - Foo things

关于matlab - 如何将文档添加到 matlab 包中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40179352/

相关文章:

matlab - 在Matlab中判断一幅图像是否为灰度

php - 是否可以通过 Composer 的自动加载器向普通类库添加命名空间?

ios - IBAction 事件含义

C# 文档字符串 : Parameter of an Action property

Matlab 积分并传入常量变量。

matlab - 将现有的 MATLAB 图绘制到另一个图中

c++ - C/C++ 中的 GNU Octave 代码等效项

PHP 使用 SimpleXML 处理命名空间

python - 使用 plac 时出现属性错误 : 'Namespace' object has no attribute

ruby - 在好的 Ruby 代码中没有注释是否被认为是可以接受的?