ABSTRACT

In trying to bring MATLAB’s object-oriented capability in line with conventional object-oriented theory, some areas are easy, some are difficult, and some are like trying to fit a square peg into a round hole. Coercing MATLAB to supply protected visibility fits into the latter category. This is mostly because MATLAB has no organic support for protected visibility. If you apply enough pressure, you can push a square peg through a round hole. Similarly, with a reasonably small increase in complexity, the group of eight can be extended to provide protected visibility. Every class must first include a pair of private functions that support protected variables in the same way

get

and

set

support public variables. Next, the child and its parents must exchange a set of function handles corresponding to the set of member functions with protected visibility. The best time to execute this exchange occurs during construction. Finally, the child’s member functions must be able to locate and use the appropriate function handles.