www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgprec/cgprec.m

    function Prec = cgprec(varargin)
%CGPREC Constructor for the cgprec class.
%
%   PREC = CGPREC(NAME) constructs a cgprec object PREC with name NAME.
%
%   PREC = CGPREC constructs a cgprec object PREC with a default name.

%  Copyright 2000-2006 The MathWorks, Inc. and Ford Global Technologies, Inc.



% Define object structure
PrecStruct = struct('Name', 'Default',...
    'Writable', 1);

if nargin>0 && ischar(varargin{1})
    % Use varargin as the cgprec object name
    PrecStruct.Name = varargin{1};
end

% Create object class
Prec = class(PrecStruct, 'cgprec');