MATLAB Object-Oriented Programming

(Joyce) #1

Setting the property value in the constructor results in a call to the property set method.




o = PropertySetMethod("New string")




set.Prop1 method called. Prop1 = New string


o =


PropertySetMethod with properties:


Prop1: "New string"


If you copy the object to another variable, MATLAB does not call the property set method
even though the right side object in the assignment uses a nondefault value for the
property:


a = o;
a.Prop1


a.Prop1


ans =


"New String"


See Also


Related Examples



  • “Property Get Methods” on page 8-60

  • “Property Access Methods” on page 8-20

  • “Validate Property Values” on page 8-24


See Also
Free download pdf