Q:

MATLAB: Make properties of a child class instance only modifiable from the parent class

I am writing some code using MATLAB object oriented programming, trying to build a system simulator.
I am trying to create a class that represents the full system. The system depends on 2 sub-modules: transmitter and receiver.
These 2 modules I also implemented using classes as they might be useful in other future scenarios.
My problem is that I want some of the properties of transmitter and receiver to have (SetAccess = public) only when they are created as independent instances, and not from withing the system class. This because when part of the full system, changes should not be done on the separate modules alone by the user.
I tried to put (SetAccess = protected) to the instances of transmitter and receiver in my system class but this does not prevent me to change their parameters from the commandwindow by doing for example: 
system.transmitter.memory = value.
Is there any way for me to implement such behavior without creating a different definition of transmitter and receiver classes?
I am quite new to OOP so let me know if this the behavior I want to achieve is wrong.
Edit: I was only putting (SetAccess = protected) because I would like the properties of my child-class to be readable but not writable

A:

You need to set both SetAccess and GetAccess as protected. The operation
system.transmitter.memory = value;

first gets the property transmitter for which you have public GetAccess and then sets memory property on the transmitter which has public access to memory property.
Setting only SetAccess in System only stops public setting of transmitter property. So,
system.transmitter = Transmitter;

will throw error.

