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

    function ch = tostring(con)
%TOSTRING  Create string representation of constraint
%
%  STR = TOSTRING(CON)
%
%  See also CONELLIPSOID, CONBASE/TOSTRING.

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

sym = getSymbols( getActiveFactors( con ) );


if con.scalefactor < 0,
    ch = 'Inverse ellipsoid at (';
else
    ch = 'Ellipsoid at (';
end

for i = 1:length( sym ),
    ch = sprintf( '%s%s=%g, ', ch, sym{i}, con.xc(i) );
end
ch = [ch(1:end-2), ')'];