?? get.m
字號:
function varargout =get(chr,varargin)% GET - Returns the values of the chromosome corresponding to% the property list. Any number of properties can be returned with one% function call. % % [val1 val2 etc...]=get(chromosome,'property','property',etc..). % The properties are:%% 'name' - the name of the chromosome% 'fitness' - the fitness of the chromosome% 'cdvs' - the continuous design variables % 'ddvs' - the discrete design variables %% to list the valid properties for a certain object use get(gene)tst=nargin;if tst==1 fprintf('Valid properties:\nname \nvalue \nbits\ndna\nid\nk')else if ~or(or(tst==2,tst==3),tst==4) error('bad number of arguments') end for k=1:tst-1 switch varargin{k} case 'name' varargout{k}=chr.name; case 'fitness' varargout{k}=chr.fitness; case 'cdvs' varargout{k}=chr.cdvs; case 'ddvs' varargout{k}=chr.ddvs; case 'id' varargout{k}=chr.id; otherwise txt=strcat('bad argument:',varargin{k}); error(txt) end endend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -