Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我找不到可以用来为自己的MATLAB函数编写帮助的格式。 官方文档中几乎没有信息。
您是否知道“帮助浏览器”(不是“帮助”功能)可以显示的任何其他格式?因为它是内置函数。如何格式化标题(如语法,说明,示例)?子弹,桌子可以吗? 还是应该是一个单独的文件? 我曾尝试将文本标记用于发布和HTML,但没有用。 我发现只有一件有趣的事情。如果您的函数包含大小写混合,例如testHelpFunction ,则其名称将突出显示: ![]() 如果只是testhelpfunction突出显示。 还有其他想法吗? 更新 这是我找到的有关创建自己的帮助文件的详尽文档: 提供您自己的帮助和演示 (死链接替换为Web存档链接) (无效链接已删除) 再次更新: 回答: 请尝试官方文档中的另一部分。更彻底。 MATLAB>用户指南>桌面工具和开发环境>定制帮助和演示>提供您自己的帮助和演示。本文介绍了简单的帮助文本和生成单独的HTML帮助文件。 这是我选择并发现有用的帮助文本格式。 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');
您可以在帮助中使用有限形式的超链接。特别是,您可以使用超链接来调用任意的Matlab命令,并通过使它调用help()来指向帮助文本的其他部分。您可以使用它来指向任何功能。 “功能>子功能”只是用于在help()调用中寻址子功能的语法。不幸的是,由于您需要在这些超链接中放入“帮助”或“ doc”,因此它只能以一种或另一种形式使用。如果有直接的帮助文本超链接形式,那就更好了。 更多&回答... |
![]() |
![]() |