?? ddv.m
字號:
function d = ddv(varargin)% DDV - Constructor for the class ddv, a sub class of the gen class.% The constructor can be called in two ways:%% ddv('name',value_1,value_2,etc..) where 'name' is a string identifying% the variable and value_1, value_2 etc. are the possible values that% the discrete variable can assume. %% ddv('name',[value_1 value_2 etc..]) here 'name' is as before but% the possible values are suppplied in a vector. % % There is no need for supplpiyng the coding bits since this is% determined by the possible values that the variable can assume. %% Calling the constructor without any argument creates an "empty" variable.%% See also CDV,CHROM,UI_GEN,UI_CHROMswitch nargin case 0 pointer=0; d=struct('ddv_val',[]); d = class(d,'ddv',gen); case 1 if isa(varargin{1},'ddv') d=varargin{1}; else error('wrong argument') end case 2 if ~isa(varargin{1},'char') error('You must specify the the id as the first argument') else for k=1:length(varargin{2}) ddv_val(k)=varargin{2}(k); end d=struct('ddv_val',ddv_val); d=class(d,'ddv',gen(varargin{1},nextpow2(ddv_val))); end otherwise if ~isa(varargin{1},'char') error('You must specify the the id as the first argument') else for k=2:nargin ddv_val(k-1)=varargin{k}; end d=struct('ddv_val',ddv_val); d=class(d,'ddv',gen(varargin{1},nextpow2(ddv_val))); endend
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -