I have two custom-made classes and each of them have an overloaded SUBSASGN function defined. Inside one of the SUBSASGN codes, the following line exists:
obj.(s(1).subs) = subsasgn(obj.(s(1).subs), s(2:end), val);
In this statement, there is an explicit call to SUBSASGN. But which SUBSASGN is being called seems to depend on the variable 'val' rather than the object class it is being assigned to. Why is that?
Best Answer