In the process of building the custom display,
size function at several
determine which state handler method to invoke.
getHeader method calls
determine whether to display a scalar or nonscalar header.
size to determine if it should look up property
values when the property group is a cell array of property names.
By default, only scalar objects display the values of properties.
If your class overloads the
then MATLAB® calls the overloading version. You must ensure that
the implementation of
size is consistent with the
way you want to display objects of the class.
An unusual or improper implementation of
result in undesirable display behavior. For example, suppose a class
size reports an object as scalar when
it is not. In this class, a property list consisting of a cell array
of strings results in the property values of the first object of the
array being displayed. This behavior can give the impression that
all objects in the array have the same property values.
However, reporting an object as scalar when in fact the object
is empty results in the object displaying as an empty object array.
The default methods of the
always determine if the input is an empty array before attempting
to access property values.
As you override
CustomDisplay methods to
implement your custom object display, consider how an overloading
size method can affect the result.