Hello guys, I've got a problem with a class of the object that I want to create. I want it to work in that way: Once I change the parameter 'A', I want second parameter 'B' to change automatically, and once I change the second parameter 'B' I want the first parameter 'A' change adequatly:
classdef ModelBrick properties A=1 B=1 end methods function a= set.A(obj) obj.A=a*obj.B; end function b= set.B(obj) obj.B=obj.A/b; end endend
Obviously it doesn't work. It enters into infinit loop. Do you have any idea how to deal with this problem? Thank you in advance.
Best Answer