Constructing Simple Hierarchies with Inheritance

Constructing Simple Hierarchies with Inheritance

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.

The paper states that by using cShape function, it has drawn shapes that look like a star, a rectangle, and a diamond. Even though these three shapes have a lot in common, it is recognized as three different shapes. The inheritance builds a set of classes to recreate this taxonomy without copying a lot of code. Member functions common to all shapes are found only in cShape. Member functions with code tailored for each particular shape type are found in each particular directory. Inheritance is the glue that allows to build the hierarchy and allows MATLAB to find the appropriate function.

Chapter Contents:

  • 12.1 Simple Inheritance
  • 12.1.1 Constructor
  • 12.1.2 Other Standard Member Functions
  • Child Class fieldnames
  • Child Class get
  • Child Class set
  • 12.1.3 Parent Slicing in Nonstandard Member Functions
  • draw.m
  • mtimes.m
  • reset.m
  • 12.2 Test Drive
  • 12.3 Summary
  • 12.4 Independent Investigations

Inspec keywords: object-oriented programming

Other keywords: member function; hierarchy construction; shape type; function inheritance; Matlab; cShape function

Subjects: Object-oriented programming

Preview this chapter:
Zoom in

Constructing Simple Hierarchies with Inheritance, Page 1 of 2

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

Related content

This is a required field
Please enter a valid email address