MATLAB: How to change property of a user defined class by using set(the_class,’the_property’,the_value) classMATLABoop How can I change property of a user defined class by using set(my_class,'my_property',my_value) Best Answer Inherit from hgsetget. Doc says: hgsetget Abstract class used to derive handle class with set and get methods Syntax classdef myclass < hgsetget Related SolutionsMATLAB: Weird class property behavior Yes, this is documented behavior. See the "Expressions In Handle Classes" section on this documentation page and the "Initializing Properties to Handle Objects" section on this documentation page. MATLAB: Set object property of a user-defined class Hey, Another Guillaume!You need to derive from hgsetget, so:classdef Picture < hgsetget properties nb_pixel_horiz; nb_pixel_verti; end end Related QuestionConstant properties in classesCompare classes with different PropertiesWriting “this” class’ propertiesInvalid default value for property error in class propertiesCan I store class properties in axes UserDataMatlab Class property sharing between different classes
Best Answer