To customize display of your object, it is best practice to either subclass
matlab.mixin.CustomDisplay
or overload the
disp
function. It is rarely necessary to overload display
.
MATLAB calls the display
function whenever an object is
referred to in a statement that is not terminated by a semicolon. If an
assignment is made, the display
function prints the name of
the variable that is being displayed. Otherwise display
uses ans
as the variable name. The
display
function then calls disp
to handle the actual display of the values. For more information, see Overload the disp Function.