cdv.m
来自「多目标遗传算法/用法不用多说、要用的赶快下载吧」· M 代码 · 共 34 行
M
34 行
function c = cdv(varargin)% CDV - Constructor for the class cdv, a sub class of the gen class.% The constructor is called as follows:%% cdv('name',low_limit,high_limit,bits) % 'name' - the name that identify the variable% low_limit - the lower limit for the variable% high_limit - the upper limit for the variable% bits - the number of bits used to code the variable%% if the constructor is called without any arguments it returns an% empty variable.% % See also CHROM,DDV,UI_GEN,UI_CHROMswitch nargin case 0 c=struct('l_limit',0,'u_limit',0); c = class(c,'cdv',gen); case 1 if isa(v,'cdv') c=varargin{1}; else error('wrong argument') end case 4 c=struct('l_limit',varargin{2},'u_limit',varargin{3}); c=class(c,'cdv',gen(varargin{1},varargin{4})); otherwise error('Wrong number of arguments')end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?