Child-Class Members

Child-Class Members

For access to this article, please select a purchase option:

Buy chapter PDF
(plus tax if applicable)
Buy Knowledge Pack
10 chapters for £75.00
(plus taxes if applicable)

IET members benefit from discounts to all IET publications and free access to E&T Magazine. If you are an IET member, log in to your account and the discounts will automatically be applied.

Learn more about IET membership 

Recommend Title Publication to library

You must fill out fields marked with: *

Librarian details
Your details
Why are you recommending this title?
Select reason:
A Guide to MATLAB® Object-Oriented Programming — Recommend this title to your library

Thank you

Your recommendation has been sent to your librarian.

An important facet of parent-child inheritance is the child's ability to tailor any function that would otherwise be conveyed from the parent. The child-class functions didn't do anything other than slice and forward. They couldn't do much more than that because the child classes inherited all of their data from the parent. Closely related to member function tailoring is the child's ability to go beyond inheritance by adding private member variables, public member variables, and member functions. Adding new m-files is straightforward. Adding new public member variables is a little more difficult because additional variable names need to be incorporated in the group-of-eight functions. Supporting these additions is exactly the reason behind the organization of get.m and set.m. These functions contained slice-and-forward sections only. There was no reason to include sections for public or concealed variables because cStar and cDiamond had none. The paper adds a public variable to cStar and examine the effects on both the implementation and inheritance.

Chapter Contents:

  • 14.1 Function Redefinition
  • 14.1.1 [email protected]/private/ctor_ini.m with Private Member Variables
  • 14.1.2 /@cStar/fieldnames.m with Additional Public Members
  • 14.1.3 /@cStar/get.m with Additional Public Members
  • 14.1.4 /@cStar/set.m with Additional Public Members
  • 14.1.5 /@cStar/draw.m with a Title
  • 14.2 Test Drive
  • 14.3 Summary
  • 14.4 Independent Investigations

Inspec keywords: object-oriented programming

Other keywords: set.m function; Matlab; group-of-eight function; cStar function; m-file; private member variable; child-class function; public member variable; member function; get.m function; cDiamond function; parent-child function inheritance

Subjects: Object-oriented programming

Preview this chapter:
Zoom in

Child-Class Members, Page 1 of 2

| /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch14-1.gif /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch14-2.gif

Related content

This is a required field
Please enter a valid email address