%% Modify Display of Symbolic Expressions in Live Scripts
% By default, symbolic expressions in live scripts are displayed in abbreviated output format, and typeset in mathematical notation. You can turn off abbreviated output format and typesetting using symbolic preferences.
% Create a symbolic expression and return the output, which is abbreviated by default.

syms a b c d x 
f = a*x^3 + b*x^2 + c*x + d;
outputAbbrev = sin(f) + cos(f) + tan(f) + log(f) + 1/f

% Turn off abbreviated output format by setting the 'AbbreviateOutput' preference to false. Redisplay the expression.

sympref('AbbreviateOutput',false);
outputLong = sin(f) + cos(f) + tan(f) + log(f) + 1/f

% Create another symbolic expression and return the output, which is typeset in mathematical notation by default. Turn off rendered output and use ASCII output instead by setting the 'TypesetOutput' preference to false. First, show the typeset output.

syms a b c d x 
f = exp(a^b)+pi

% Turn off typesetting by setting the 'TypesetOutput' preference to false. Redisplay the expression.

sympref('TypesetOutput',false);
f = exp(a^b)+pi

% The preferences you set using sympref persist through your current and future MATLAB sessions. Restore the default values of 'AbbreviateOutput' and 'TypesetOutput' by specifying the 'default' option.

sympref('AbbreviateOutput','default');
sympref('TypesetOutput','default');

%
% Copyright 2016 The MathWorks, Inc.