www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@conrange/tostring.m
function ch = tostring( c ) %TOSTRING Create string representation of constraint % STR = TOSTRING(CON) % % See also CONRANGE, CONBASE/TOSTRING. % Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc. factors = getSymbols( getActiveFactors( c ) ); a = c.Center - c.HalfWidth; b = c.Center + c.HalfWidth; ch = sprintf( '%.3g<=%s<=%.3g', a(1), factors{1}, b(1) ); for i = 2:length( factors ), ch = strcat( ch, sprintf( ' & %.3g<=%s<=%.3g', a(i), factors{i}, b(i) ) ); end %------------------------------------------------------------------------------| % EOF %------------------------------------------------------------------------------|