%% Save and Restore Display Format
% Since R2021a
% Save the current display format and restore it at a later time.
% Set the numeric display to shortE and display a 2-by-2 matrix of numeric values.

format shortE
m = [9638573934 37467; 236 574638295]

%
% Save the current display format in oldFmt and change the numeric format to longE.

oldFmt = format("longE")

%
% Confirm that the numeric format is now long, scientific notation by redisplaying matrix m.

m

%
% Restore the format to its previous state. Redisplay m to confirm that the numeric format is now short, scientific format.

format(oldFmt)
m

%
% Copyright 2020 The MathWorks, Inc.