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

    function d = pLocalConstraintDistance(con, beta, L)
%PLOCALCONSTRAINTDISTANCE Return distance from local constraints
%
%  D = PLOCALCONSTRAINTDISTANCE(CON, BETA, L) returns the distance from the local
%  constrained region for each local point in L. 
%
%  See also CONTWOSTAGE, CONTWOSTAGE/CONSTRAINTDISTANCE.
%
% TO DO : What size should the local points L be? Should it be all local
% factors or just active local factors?

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

[lc, ok] = setFeatures( con.Local, beta );
if ok,
    if ~isempty( con.LocalFriend ),
        L = code( con.LocalFriend, L );
    end
    d = constraintDistance( lc, double( L ) );
else
    % There was an error setting the parameters in the local model.
    % Assume this means we are out of range
    d = repmat( +Inf, size( L, 1 ), 1 );
end

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