如何为面向对象的MATLAB代码生成良好的文档? [英] How can one generate good documentation for object-oriented MATLAB code?

查看:142
本文介绍了如何为面向对象的MATLAB代码生成良好的文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种生成面向对象的MATLAB代码的文档的方法。使用doc classname可以精确地吐出我需要的东西(类头,属性w /说明,方法列表和描述,没有代码),但是不能保存。只有通过MATLAB帮助才可以查看。我已经尝试过MATLAB发布工具,但它实际上用于发布脚本和基本功能。 m2html将会很棒,但不支持类。

I'm looking for a way to generate documentation for object-oriented MATLAB code. Using "doc classname" spits out exactly what I need (class header, properties w/ descriptions, list of methods and their description, no code) but you can't save it. It's only viewable through MATLAB help. I've tried the MATLAB publishing tool but it is really meant for publishing scripts and basic functions. m2html would be great but it doesn't support classes.

推荐答案

内部 help2html c $ c> c code $函数可以让你一些方法。尝试这样:

The internal help2html function that is called by doc will get you some of the way there. Try this:

htmlstr = help2html('myClassName','','-doc');
fid = fopen('myClassName.html','w');
fprintf(fid,'%s',htmlstr);
fclose(fid)

这将使您成为一个html文件,其中包含班,这是一个开始。文件中的链接都将以matlab:helpwin的形式出现,这些格式可以在MATLAB的内部浏览器中使用。您可以通过并修改链接,也可以尝试将html文件合并到MATLAB的帮助中:
将文档添加到帮助浏览器

This will make you an html file that contains the documentation for the class, which is a start. The links in the file will all be of the form 'matlab:helpwin' though, which are intended for use within MATLAB's internal browser. You can either go through and alter the links, or you can try to incorporate the html files into MATLAB's help along these lines: Add Documentation to the Help Browser.

这篇关于如何为面向对象的MATLAB代码生成良好的文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆