Matlab creating help but ignoring the header
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi, I am writing a MATLAB package (classes, functions, etc.). I've been adding documentation below the first line of code. e.g. Below 'classdef' or 'function'. When you type help 'someClass' it works fine automatically generating the help information.
Now, I'm trying to add a header (the same header) to all of my files. I add this as a comment above the 'classdef' or 'function' line. But when I type help 'someClass', it displays just the header not the help info.
What can I do??
댓글 수: 0
답변 (1개)
Oleg Komarov
2014년 9월 18일
The help should be a continuous block of comments. This means that the classdef or function declarations constitute a termination of the block of comments.
For instance, you can do:
% H1 line Bla Bla
%
% Syntax ...
%
% Examples
%
% See also
%
function
But not :
% H1 line Bla Bla
function
%
% Syntax ...
%
% Examples
%
% See also
%
댓글 수: 2
Oleg Komarov
2014년 9월 18일
Which part of the "you cannot do that" is not clear? It has to be a continuous block of comments.
Usually the structure of a help in Matlab is:
% H1 line
% Syntax
% Examples
% See Also
% Copyright/contact info
The H1 line, is what you call header. HAS to be on one line. The copyright is usually not displayed in the help, since the line break, but it's up to you really.
참고 항목
카테고리
Help Center 및 File Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!