MATLAB: Doesn’t the methods() command display set.property() and get.property() methods of a class? What alternative can be used to find them

getmetamethodsooppropertyset

Why doesn't the methods() command display set.property() and get.property() methods of a class? What alternative can be used to find them programmatically? Something with meta classes, perhaps?

Best Answer

The fact that methods doesn't show the property accessor methods is documented behavior. See the "Defining Access Methods" subsection in the "Property Setter and Getter Methods" section on this documentation page. I believe the rationale for that decision is that you cannot invoke these methods yourself manually, that you only invoke them by trying to set or get the property values.
When you say that you want to "find them programmatically" I assume you want to see where the code is located so you can read it? As stated above, you cannot invoke them directly. Create and access the properties of the meta.property object as illustrated in the "Access Method Function Handles" subsection in the "Property Setter and Getter Methods" section on the documentation page to which I linked above.