MATLAB Object-Oriented Programming

(Joyce) #1

ans =


meta.property


Each array element is a single meta.property object:


mc.Properties(1)


ans =


[1x1 meta.property]


The Name property of the meta.property object contains a char vector that is the name
of the property:


class(mc.PropertyList(1).Name)


ans =


char


Apply standard MATLAB indexing to access information in metaclass objects.


For example, the meta.class PropertyList property contains an array of
meta.property objects. The following expression accesses the first meta.property
object in this array and returns the first and last (C and t) letters of the char vector
contained in the meta.property Name property.


mc.PropertyList(1).Name([1 end])


ans =


Ct


How to Find Properties with Specific Attributes


This example implements a function that finds properties with specific attribute values.
For example, you can:



  • Find objects that define constant properties (Constant attribute set to true).

  • Determine what properties are read-only (GetAccess = public, SetAccess =
    private).


Get Information About Properties
Free download pdf