📄 construct_enum.m
字号:
function nn = construct_enum(en,args)
%CONSTRUCT_ENUM Constructor for raw memory object
% MM = CONSTRUCT_ENUM('PropertyName',PropertyValue,...) Constructs an ..
%
% Major Properties (See NUMERIC)
% -----------------
% REPRESENT -
%
% See Also NUMERIC,MEMORYOBJ
%
% Copyright 2002 The MathWorks, Inc.
% $Revision: 1.3 $ $Date: 2002/02/15 20:37:50 $
en.label = {};
en.value = [];
% Process constructors input arguments if any
if nargin <= 1
return; % Use defaults
end
nargs = length(args);
if(mod(nargs,2)~=0)
error(['POINTER constructor requires property and value ', ...
'arguments to be specified in pairs.']);
end
% Get property / value pairs from argument list
for i = 1:2:nargs
prop = lower(args{i});
val = args{i+1};
% Argument checking
if isempty(prop) % ignore nulls
continue;
elseif ~ischar(prop),
error('Property Name must be a string entry');
end
if ~isempty( strmatch(prop,{'value','label'},'exact'))
en.(prop) = val;
args{i} = [];
args{i+1} = [];
end
end
construct_numeric(en,args); % Call base constructor (rest of properties ..)
en.convert('int'); % by default, enum is stored as integer
% [EOF] construct_enum.m
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -