%% Modify Display of Symbolic Matrix in Live Scripts
% By default, a symbolic matrix in live scripts is set in parentheses (round brackets). You can specify the use of square brackets instead by using sympref.
% Create a symbolic matrix consisting of symbolic variables and numbers.

syms x y
A = [x*y, 2; 4, y^2]

% Display the matrix with square brackets by setting the 'MatrixWithSquareBrackets' preference to true.

sympref('MatrixWithSquareBrackets',true);
A

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

sympref('MatrixWithSquareBrackets','default');

%
% Copyright 2018 The MathWorks, Inc.