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

    function con = constar( cif )
%CONSTAR   Star-shaped constraint object
%
%  CON = CONSTAR(CIF)
%
%  CONSTAR objects constrain points according an RBF model of a star shaped
%  region. 
%
%  See also CONBASE, CONINPUTFACTOR.

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

if ~nargin % no input arguments
    cif = coninputfactor( 2 );
end

if isa( cif, 'constar' ),
    con = cif;
else
    if isstruct( cif ), 
        parent = cif.conbase;
        con = mv_rmfield( cif, 'conbase' );
    else
        parent = conbase( cif );
        con = struct( ...
            'Version', 6, ...
            'Model', [], ...
            'Center', 0.5 * (cif.Min + cif.Max), ...
            'Transform', 'None',...
            'Offset',0);
    end
    con = class( con, 'constar', parent );
    if isempty(con.Model)
        con.Model = pDefaultModel( con );
        con = pSetModelCoding( con );
    end
end

%--------------------------------------------------------------------------
% EOF
%--------------------------------------------------------------------------