Main Content

getLabelDefinitions

Get label definitions in labeled signal set

Description

example

lbldefs = getLabelDefinitions(lss) returns a vector of signalLabelDefinition objects with the labels of the labeled signal set lss.

Changing lbldefs does not affect the labeled set. To modify label definitions, use editLabelDefinition, addLabelDefinitions, and removeLabelDefinition.

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.

Retrieve the definitions of the labels in the set.

dfs = getLabelDefinitions(lss);

for k = 1:length(dfs)
    dfs(k)
end
ans = 
  signalLabelDefinition with properties:

             Name: "WhaleType"
        LabelType: "attribute"
    LabelDataType: "categorical"
       Categories: [3x1 string]
     DefaultValue: []
        Sublabels: [0x0 signalLabelDefinition]
              Tag: ""
      Description: "Whale type"

 Use labeledSignalSet to create a labeled signal set.
ans = 
  signalLabelDefinition with properties:

                  Name: "MoanRegions"
             LabelType: "roi"
         LabelDataType: "logical"
    ValidationFunction: []
     ROILimitsDataType: "double"
          DefaultValue: []
             Sublabels: [0x0 signalLabelDefinition]
                   Tag: ""
           Description: "Regions where moans occur"

 Use labeledSignalSet to create a labeled signal set.
ans = 
  signalLabelDefinition with properties:

                  Name: "TrillRegions"
             LabelType: "roi"
         LabelDataType: "logical"
    ValidationFunction: []
     ROILimitsDataType: "double"
          DefaultValue: []
             Sublabels: [1x1 signalLabelDefinition]
                   Tag: ""
           Description: "Regions where trills occur"

 Use labeledSignalSet to create a labeled signal set.

Input Arguments

collapse all

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

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

Introduced in R2018b