ABSTRACT

Inheritance builds a hierarchy by allowing us to specify a relationship between a parent and child class. In the relationship, a child class is said to inherit attributes and behaviors from the parent.** Behaviors are synonymous with member functions, and in MATLAB, finding a member function involves the function path. For sure, MATLAB will search for a function in the child class’ directory. With inheritance, if the function is not found in the child’s directory, MATLAB will also search the parent’s directory. If we are going to allow MATLAB to call one of the parent’s functions, the object must contain all of the parent’s member variables. The second part of inheritance relates to data. A child object contains all parent data but parent data are still encapsulated. The child is allowed entry to the parent’s members-only club, but the child does not enjoy all of the same privileges.