1.美化显示结果
simplify函数, pretty函数, symdisp函数-
要将simplify.m文件放进添加到访问路径的文件夹。
symdisp函数源代码:
function h=symdisp(s)
%//SYMDISP Display a symbolic expression in human readable form.
%// symdisplay(S) displays the symbolic expression S in a small figure window,
%// using standard mathematical notation.
%//
%// Examples:
%// syms x t positive
%// f=taylor(cos(x));
%// symdisp(f)
%// f=int(exp(-t)*t^(x-1),t,0,inf);
%// symdisp(f)
%//
%// Required toolbox: Symbolic Math
%//
%// See also SYMBOLIC PRETTY.
if ~isa(s,'sym')
s=sym(s);
%error('输入参数必须是sym类型,请使用 sym() 将你的结果转化为sym类型.')
end
S=['$',latex(s),'$'];
S=strrep(S,'&','& \quad');
S=strrep(S,'{\it','\mathrm{');
h=msgbox(S,'字符的数学展示形式');
h1=get(h,'ch