www.gusucode.com > mbcmodels 工具箱 matlab 源码程序 > mbcmodels/@xregarx/str_view.m
function [Lines, Bold, Indent] = str_view(m, Name) %STR_VIEW Create strings for displaying full model description % % [LINES, BOLD, INDENT] = STR_VIEW(M) returns information that is used for % displaying the model description. LINES is a cell array containing % separate lines of text. BOLD and INDENT are logical arrays the same % size as LINES that indicate whether a line should be bold or indented. % % [...] = STR_VIEW(M, NAME) creates a model description that references % the model by the specified name instead of the default output variable % name. % % This method is called by the modelpane object to provide display % information. It is expected that LINES may contain tex expressions. % Copyright 2000-2004 The MathWorks, Inc. and Ford Global Technologies, Inc. Expr = str_code(m,1); SMExpr = str_code(m.StaticModel,1); % get the coding info for the embedded static model fX = str_func(m,1); ytrans = str_yinv(m,1); chModel = char(m,1); if nargin<2 yi = yinfo( m ); Name = yi.Name; end Name = detex(Name); Lines = [{['Model for ',Name]};... % Description {'Coding'}; ... Expr(:); ... % Coding {fX};... % Function description cellstr(chModel); ... % Equation display {'Coding of Static Model'};... SMExpr(:)] ; % Static model Coding Bold = [true; ... true; ... false(length(Expr), 1); ... true; ... false(size(chModel,1),1); ... true; ... false(length(SMExpr),1)]; Indent = ~Bold; % Transform if ~isempty(ytrans); Lines = [Lines; {'Y Transformation';[detex(m.Yinfo.Name),' = ',ytrans]}]; Bold = [Bold; true; false]; Indent = [Indent; false; true]; end