How can I make setter function works on a child class?
classdef Foo < matlab.mixin.Heterogeneous properties foo = 5; end methods function setFoo(obj, foo) obj.foo = foo; end endendclassdef BabyFoo < Foo methods function obj = BabyFoo() obj = obj@Foo(); end endend>> test = BabyFoo();>> test.foo; % 5
>> test.setFoo(10);>> test.foo; % 5 (Why it's not 10 ?!)
Best Answer