hi, i got the following class:
classdef form<handle properties type = 'square' b h A Iy Iz Wy Wz end %properties
events calc end %events
methods function f = form(b,h) f.b=b; f.h=h; f.update() end function obj = update(obj) obj.A= obj.h*obj.b; obj.Iy= obj.h^3*obj.b/12; obj.Iz= obj.b^3*obj.h/12; obj.Wy= obj.h^2*obj.b/6; obj.Wz= obj.b^2*obj.h/6; end end % events
end%class
how do i manage to call the function update everytime when either form.a or form.h of an instance is changed withoud adding a listener to the instance? is there a way to directly built thin in the class definition?
thanks a lot for help
Best Answer