MATLAB Object-Oriented Programming

(Joyce) #1

Customize Display of Object Arrays


In this section...
“Objective” on page 18-37
“Design of Custom Display” on page 18-37
“The displayNonScalarObject Override” on page 18-38
“The displayEmptyObject Override” on page 18-39

Objective


Customize the display of nonscalar objects, including empty object arrays.

Design of Custom Display


NoteThis example uses the EmployeeInfo class described in the “Class with Default
Object Display” on page 18-14 section.

The objective of this customized display is to:


  • Construct a custom header using some elements of the default header

  • Display a subset of property-specific information for each object in the array.

  • List handles to deleted objects in the array using a char vector with links to
    documentation for handle objects and the class.

  • Display empty objects with a slight modification to the default header


Here is the customized display of an array of three EmployeeInfo objects

1x3 EmployeeInfo array with members:


  1. Employee:
    Name: 'Bill Tork'
    Department: 'Product Development'

  2. Employee:
    Name: 'Alice Blackwell'
    Department: 'QE'


Customize Display of Object Arrays
Free download pdf