Changing the Rules ... in Appearance Only

Changing the Rules ... in Appearance Only

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 develops a set of member functions in MATLAB that implement the tailoring in a way that allows objects to mimic structures. It takes advantage of a pair of standard, but relatively unknown, functions, subsref.m and subsasgn.m. The built-in versions operate on structures. Tailored versions, as long as MATLAB can find them, operate on objects. As tailored member functions, subsref.m and subsasgn.m are so critical to object-oriented programming that they share a place beside the constructor in the group of eight.

Chapter Contents:

  • 4.1 A Special Accessor and a Special Mutator
  • 4.1.1 A Short Side Trip to Examine Overloading
  • Superiorto and Inferiorto
  • The Built-in Function
  • 4.1.2 Overloading the Operators subsref and subsasgn
  • Dot-Reference Indexing
  • subsref Dot-Reference, Attempt 1
  • A New Interface Definition
  • subsref Dot-Reference, Attempt 2: Separating Public and Private Variables
  • subsref Dot-Reference, Attempt 3: Beyond One-to-One, Public-to-Private
  • subsref Dot-Reference, Attempt 4: Multiple Indexing Levels
  • subsref Dot-Reference, Attempt 5: Operator Conversion Anomaly
  • subsasgn Dot-Reference
  • Array-Reference Indexing
  • subsref Array-Reference
  • subsasgn Array-Reference
  • Cell-Reference Indexing
  • 4.1.3 Initial Solution for subsref.m
  • 4.1.4 Initial Solution for subsasgn.m
  • 4.1.5 Operator Overload, mtimes
  • 4.2 The Test Drive
  • 4.2.1 subsasgn Test Drive
  • 4.2.2 subsref Test Drive
  • 4.3 Summary
  • 4.4 Independent Investigations

Inspec keywords: object-oriented programming

Other keywords: MATLAB member function; subsasgn.m function; subsref.m function; MATLAB member structure; object-oriented programming

Subjects: Object-oriented programming

Preview this chapter:
Zoom in

Changing the Rules ... in Appearance Only, Page 1 of 2

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

Related content

This is a required field
Please enter a valid email address