Normal objects are usually considered value
objects. When they are passed to a function or a method, only the value is passed not a reference to the original object. Matlab may use a read-only referencing mechanism to speed things up, but the function or method cannot change the properties of the original object.
To be able to pass an input parameter by reference, your custom object needs to be a handle
object. Simply when defining your class, inherit from handle
and that should do the trick:
classdef Person < handle
and
classdef Family < handle