I've been using MATLAB's object-oriented programming features to build a set of classes to represent my data. Essentially, the way the data is structured, many of the classes are containers that encapsulate instances of other classes. Sometimes it would be advantageous for the container classes to access fields of the encapsulated objects they hold. However, they are not allowed to do so because "access to an object's fields is only permitted within its methods."
I could, of course, write accessor methods for each situation that calls for a container or iterator class to access data from a subordinate object. However, the classes are so closely related that it is not an unreasonable thing to want to permit the container or iterator class to have direct access to the internal fields of the subordinate object. In the C++ world, one would make the two classes "friends" and this would allow the access. Is there an equivalent operation in MATLAB's class system that will permit one class to access the fields of another class?