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

    function friend = pMakeFriend(con, friend)
%PMAKEFRIEND Make a "friend" model from an XREGMODEL.
%
%  FM = PMAKEFRIEND(CON, M)
%
%  A friend model is an XREGMODEL that does all the coding for a
%  constraint. Friend models are no longer used for constraints in MBC, but
%  they are still required to upgrade old constraints. The target range for
%  a friend model is [-1, 1].
%
%  See also CONBASE, CONBASE/UPGRADE.

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

[bnds, g, tgt] = getcode( friend );
tgt(:,1) = -1; 
tgt(:,2) =  1; 
friend = setcode( friend, bnds, g, tgt );

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