A Guide to MATLAB Object-Oriented Programming

This section focuses on building hierarchies because objects and hierarchies go hand in hand. For example, a hierarchy of shapes might include rectangles, stars, and circles. A hierarchical implementation allows one class to build on functions defined in another class. An object-oriented hierarchy can do this without a lot of rework. Throughout the first section, we simplified much of our code by coercing MATLAB into doing a lot of the work. In a small way, all classes are hierarchical because they build on the built-in types. MATLAB is always at the top of the hierarchy. A deeper hierarchy of classes follows the same philosophy. The lower-level class, sometimes called the child, tries to coerce a higher-level class, the parent, into doing as much as possible. This is the way of a hierarchy: always try to force the next higher level into doing all the work.
When a child class coerces a parent to perform an operation, the child is said to inherit that particular function from the parent. There are different flavors of inheritance. Differences depend on how control passes to the parent. A parent child relationship is what we normally think...