Main Content

concatenate

Concatenate two or more labeled signal sets

Description

example

lssnew = concatenate(lss1,...,lssN) concatenates N labeled signal set objects, lss1,...,lssN, and returns a labeled signal set lssnew containing all the members and label values of the input sets.

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.

Create a new signal set with the same data source, time information, and labels as lss.

newlss = copy(lss)
newlss = 
  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.

Concatenate the two signal sets.

lssconcat = concatenate(lss,newlss)
lssconcat = 
  labeledSignalSet with properties:

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

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

Input Arguments

collapse all

Input labeled signal sets, specified as labeledSignalSet objects. All input sets must have the same time information settings, label definitions, and data source type.

Output Arguments

collapse all

Concatenated labeled signal set, returned as a labeledSignalSet object. The set lssnew contains a signal source, label definitions, and label values that are independent of those in the input labeled signal sets. Changing any of the input labeled signal sets does not affect the concatenated labeled signal set. Changing the concatenated labeled signal set does not affect the input label signal sets.

Introduced in R2018b