主要内容

namespaceClasses

Classes defined in specified namespace

Since R2026a

Description

cObj = namespaceClasses(namesp) returns an array of matlab.metadata.Class objects that describe the classes defined in the specified namespace. namespaceClasses only returns classes that are visible in the current context.

example

Examples

collapse all

Get an array of matlab.metadata.Class objects representing the classes defined in the matlab.display namespace.

c = namespaceClasses("matlab.display")
c = 

  5×1 Class array with properties:

    Name
    Description
    DetailedDescription
    Hidden
    Sealed
    Abstract
    Enumeration
    ConstructOnLoad
    HandleCompatible
    InferiorClasses
    Namespace
    Aliases
    RestrictsSubclassing
    PropertyList
    MethodList
    EventList
    EnumerationMemberList
    SuperclassList

Access the first instance in the returned array.

class1 = c(1)
class1 = 

  Class with properties:

                     Name: 'matlab.display.CompactDisplayRepresentation'
              Description: 'Representation of data for displaying within a 
                            container or under space constraints'
      DetailedDescription: ''
                   Hidden: 0
                   Sealed: 0
                 Abstract: 1
              Enumeration: 0
          ConstructOnLoad: 0
         HandleCompatible: 0
          InferiorClasses: [0×1 matlab.metadata.Class]
                Namespace: [1×1 matlab.metadata.Namespace]
                  Aliases: [0×1 string]
     RestrictsSubclassing: 0
             PropertyList: [3×1 matlab.metadata.Property]
               MethodList: [2×1 matlab.metadata.Method]
                EventList: [0×1 matlab.metadata.Event]
    EnumerationMemberList: [0×1 matlab.metadata.EnumerationMember]
           SuperclassList: [0×1 matlab.metadata.Class]

Input Arguments

collapse all

Namespace, specified as a string or character vector.

Output Arguments

collapse all

Metadata for classes in the specified namespace, specified as a matlab.metadata.Class array.

Version History

Introduced in R2026a