www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregusermod/char.m
function ch= char(U,TeX) %CHAR string (possibly TeX) for display % Copyright 2000-2007 The MathWorks, Inc. and Ford Global Technologies, Inc. if nargin<2 TeX=1; end ch= ''; try ch= feval(U.funcName,U,'char'); if ~isempty(ch) && ~ischar(ch) ch = ''; error(message('mbc:xregusermod:InvalidValue2', name( U ))) end catch ME if ~strcmp(ME.identifier,'MATLAB:UndefinedFunction') || isempty(strfind(ME.message,'i_char')) ReportError(U,ME) end end if isempty(ch) s= get(U,'symbol'); if TeX s= detex(s); end syms= sprintf('%s,',s{:}); p= sprintf('%.3g,',U.parameters); if TeX ch= sprintf('%s([%s],\\beta=[%s', name(U),syms(1:end-1),p(1:end-1)); else ch= sprintf('%s([%s],b=[%s', name(U),syms(1:end-1),p(1:end-1)); end ch= [ch,'])']; end