Pass-by-Reference Emulation

Pass-by-Reference Emulation

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.

In an object-oriented design, strict adherence to pass-by-value is at best inconvenient, and at worst it compromises the quality of a design. MATLAB doesn't support pointers; however, under certain conditions, a trio of commands gives a good approximation to pass-by-reference. The three commands are inputname, evalin , and assignin. These commands are not limited to object-oriented programming, and the discussion in this chapter will help sort out some of the general pitfalls of using them both inside and outside an object-oriented implementation.

Chapter Contents:

  • 21.1 Assignment without Equal
  • 21.2 Pass-by-Reference Functions
  • 21.3 Pass-by-Reference Draw
  • 21.4 Pass-by-Reference Member Variable: View
  • 21.4.1 Helpers, get, and subsref with Pass-by-Reference Behavior
  • Pass-by-Reference Behavior in the Helper
  • Pass-by-Reference Code in get.m
  • Pass-by-Reference Code in subsref.m
  • 21.4.2 Other Group-of-Eight Considerations
  • 21.5 Test Drive
  • 21.6 Summary
  • 21.7 Independent Investigations

Inspec keywords: mathematics computing; object-oriented programming

Other keywords: MATLAB; object-oriented programming; pass by value; pass by reference emulation

Subjects: Object-oriented programming; Mathematics computing

Preview this chapter:
Zoom in

Pass-by-Reference Emulation, Page 1 of 2

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

Related content

This is a required field
Please enter a valid email address