Main Content

labelDefinitionsHierarchy

Get hierarchical list of label and sublabel names

Description

example

str = labelDefinitionsHierarchy(lbldefs) returns a character array with a hierarchical list of label and sublabel names contained in lbldefs, a vector of signalLabelDefinition objects.

str = labelDefinitionsHierarchy(lss) returns a character array with a hierarchical list of label and sublabel names contained in the labeledSignalSet object lss.

Examples

collapse all

Load a labeled signal set containing recordings of whale songs.

load whales
lss
lss = 
  labeledSignalSet with properties:

             Source: {2x1 cell}
         NumMembers: 2
    TimeInformation: "sampleRate"
         SampleRate: 4000
             Labels: [2x3 table]
        Description: "Characterize wave song regions"

 Use labelDefinitionsHierarchy to see a list of labels and sublabels.
 Use setLabelValue to add data to the set.

Visualize the label hierarchy of the set.

labelDefinitionsHierarchy(lss)
ans = 
    'WhaleType
       Sublabels: []
     MoanRegions
       Sublabels: []
     TrillRegions
       Sublabels: TrillPeaks
     '

Input Arguments

collapse all

Signal label definitions, specified as a signalLabelDefinition object or a vector of signalLabelDefinition objects.

Example: signalLabelDefinition("Asleep",'LabelType','roi','LabelDataType','logical') can label a region of a signal in which a patient is asleep.

Labeled signal set, specified as a labeledSignalSet object.

Example: labeledSignalSet({randn(100,1) randn(10,1)},signalLabelDefinition('female')) specifies a two-member set of random signals containing the attribute 'female'.

Output Arguments

collapse all

List of label and sublabel names, returned as a character array.

Introduced in R2018b