matlab中的m-file,MATLAB m-file帮助格式化

在官方文档中尝试这个其他部分。更彻底MATLAB>用户指南>桌面工具与开发环境>自定义帮助和演示>提供您自己的帮助和演示。这描述了简单的helptext和生成单独的HTML帮助文件。

这是我接受的helptext格式,发现有用。

function foo(x,y,z)

%FOO One-line description goes here

%

% foo(x,y,z)

%

% Multi-line paragraphs of descriptive text go here. It's fine for them to

% span lines. It's treated as preformatted text; help() and doc() will not

% re-wrap lines. In the editor, you can highlight paragraphs, right-click,

% and choose "Wrap selected comments" to re-flow the text.

%

% More detailed help is in the extended help.

% It's broken out like this so you can keep the main "help foo" text on

% a single screen, and then break out obscure parts to separate sections.

%

% Examples:

% foo(1,2,3)

%

% See also:

% BAR

% SOMECLASS/SOMEMETHOD

disp(x+y+z);

function extended_help

%EXTENDED_HELP Some additional technical details and examples

%

% Here is where you would put additional examples, technical discussions,

% documentation on obscure features and options, and so on.

error('This is a placeholder function just for helptext');

>函数签名后的第一行称为“H1行”。它需要只是一行,所以它被内容rpt()正确地拾取,它可以从你的函数中的helptext自动生成一个Contents.m文件

> H1行中的函数名称都是大写,不管签名中函数名称的实际大小写

>案例涉及“另见”。我不知道哪一个案例都行事;这个确实是这样的。

>“参见:”之后的函数名称都是大写。方法名称合格;我认为与当前方法在同一类中的方法的名称可以是不合格的。

H1线和“示例:”之间的所有内容只是一种常见的格式化,我发现可读性; help()不特别对待。

您可以在帮助中使用有限形式的超链接。特别是,您可以使用超链接来调用任意的Matlab命令,并通过调用help()来指向helptext的其他部分。您可以使用它来指向任何功能; “function> subfunction”只是用于在help()调用中寻址子函数的语法。不幸的是,由于您需要将这些超链接中的“帮助”或“doc”放在一个或另一个表示形式中。如果有直接的helptext超链接形式会更好。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值