[2] 实验编程 · 2021年2月22日

给函数写帮助文件

matlab给函数写帮助文档

unction c = addme(a,b)
% ADDME  Add two values together.
%   C = ADDME(A) adds A to itself.
%
%   C = ADDME(A,B) adds A and B together.
%
%   See also SUM, PLUS.
% test random forest, rotation forest, ccf
% 
% function demoFunc(treeN,flag,dataDir,gtDir,name_data,name_gt)
%       Input:
%           treeN           - number of trees
%           flag            - 'rf','rof','ccf' for corresponding method
%           dataDir         - remote sensing data folder
%           gtDir           - ground truth data folder
%           name_data       - 'name' of rs data
%           name_gt         - 'name' of ground truth data
% 
%       Output:
%           none
%       
% copyright note
%       author: pei liu
%       date:   2020.7.25
switch nargin
case 2
c = a + b;
case 1
c = a + a;
otherwise
c = 0;
end