ABSTRACT
One of the exercises back in Chapter 3 asked you to examine the possible benefits of developing one get
and one
set
instead of a get
and
set
pair for every public variable. That was before the implementations of
subsref
and
subsasgn
. Since subsref
and
subsasgn
provide such an elegant, natural interface, perhaps there is no longer a need for get
or
set
. There are still benefits, but it seems the most compelling reasons were stolen away by
subsref
and
subsasgn
. In this chapter, we will examine some of the benefits and define implementations for
get
and
set
that add quite a lot of flexibility. The functions
get
and
set
complete the membership roles for the group of eight.