📄 help2.m
字号:
function helpString = help2(mfilename)%HELP2 Displays the second help text of an M-file.%%--------%Synopsis:% help2 mfilename% help2('mfilename')% helpString = help2('mfilename')%%Description:% The second help text of an M-file is the second consecutive block of% lines beginning with the '%' character.%%Input:% mfilename (): The name of the M-file whose second help text to % display. The name can be with or without the extension '.m'.%%Output:% helpString (StringT): The help text in a '\n' separated string.%%--------%Examples:% help2 uistart% help2('uistart')%%See Also:% help, helpwin% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% Start : xxxxx Svante Bj鰎klund (svabj).% Latest change: $Date: 2000/10/16 15:40:16 $ $Author: svabj $.% $Revision: 1.3 $% *****************************************************************************helpString = '';literal = '%';if (isempty(findstr(mfilename,'.m'))) mfilename = [mfilename,'.m'];end%iffid = fopen(mfilename, 'rt');if (fid == -1) if (nargin == 0) disp([mfilename,' not found.']) end%ifelse skipnonhelp(fid) skiphelp(fid) skipnonhelp(fid) %y = 0; while (feof(fid) == 0) line = fgetl(fid); matches = findstr(line, literal); num = length(matches); if (num > 0) %y = y + num; if (nargout ==0) % Display on screen. fprintf(1,'%s\n',line(2:length(line))); else % Return the help text in a '\n' separated string. tmpStr = sprintf('%s\n',line(2:length(line))); helpString = [helpString, tmpStr]; end%if else break end%if end %while fclose(fid);end%if (fid == -1)%endfunction help2function skipnonhelp(fid) literal = '%'; while (feof(fid) == 0) filePos = ftell(fid); line = fgetl(fid); if ~isempty(findstr(line, literal)) fseek(fid,filePos,'bof'); %Rewind one character. break end%if %fprintf('skipnonhelp\n') end %while%endfunction skipnonhelpfunction skiphelp(fid) literal = '%'; while (feof(fid) == 0) filePos = ftell(fid); line = fgetl(fid); if isempty(findstr(line, literal)) fseek(fid,filePos,'bof'); %Rewind one character. break end%if %fprintf('skiphelp\n') end %while%endfunction skipnonhelp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -