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

    function con = conbase( cif )
%CONBASE Base (abstract) class for MBC Constraint objects
%
%  CON = CONBASE(CIF)
%
%  See also CONINPUTFACTOR.

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

if ~nargin, % no input arguments
    cif = coninputfactor;
end

if isa( cif, 'conbase' ),
    con = cif;
else
    if isstruct( cif ),
        con = cif;
    elseif ~isa( cif, 'coninputfactor' ),
        error(message('mbc:conbase:InvalidArgument1'));
    else
        con = struct( ...
            'Version', 2, ...
            'Name', 'Constraint', ...
            'InputFactors', cif, ...
            'ActiveFactors', 1:length( cif ) );
    end
    con = class( con, 'conbase' );
end

%------------------------------------------------------------------------------|
% EOF
%------------------------------------------------------------------------------|