www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conconvexhull/pUpdateScaleFactor.m
function obj = pUpdateScaleFactor(obj) %PUPDATESCALEFACTOR Update the scale factor stored in the linear constaint % % CON = PUPDATESCALEFACTOR(CON) % % The scale factor is used to ensure that the constraint distance for a % linear constraint has the correct growth. However, it can be expensive % to compute it a large number times and this is annoying when it is % constant. % % See also CONCONVEXHULL, CONCONVEXHULL/CONSTRAINTDISTANCE. % Copyright 2005 The MathWorks, Inc. if isempty( obj.A ), obj.ScaleFactor = []; else cif = getActiveFactors( obj ); D = diag( 0.5 * (cif.Max - cif.Min) ); obj.ScaleFactor = sqrt( sum( (obj.A * D).^2, 2 ) ); end %------------------------------------------------------------------------------| % EOF %------------------------------------------------------------------------------|