www.gusucode.com > mbcdesign 工具箱 matlab 源码程序 > mbcdesign/@contwostage/tostring.m
function ch=tostring(c) %TOSTRING Create string representation of constraint % % STR = TOSTRING(CON) % % See also CONTWOSTAGE, CONBASE/TOSTRING. % % Copyright 2000-2005 The MathWorks, Inc. and Ford Global Technologies, Inc. gs = getSymbols( getglobalfactors( c ) ); ls = getSymbols( getlocalfactors( c ) ); ch = sprintf( '%s( %s', typename( c.Local ), ls{1} ); for i = 2:length( ls ), ch = [ch, sprintf( ', %s', ls{i} ) ]; end ch = [ch, sprintf( '; f(%s', gs{1} ) ]; for i = 2:length( gs ), ch = [ch, sprintf( ', %s', gs{i} ) ]; end ch = [ch, ') )']; return %------------------------------------------------------------------------------| % EOF %------------------------------------------------------------------------------|