merge
Description
merges N labeled signal set objects, lssnew
= merge(lss1,...,lssN
)lss1,...,lssN
,
and returns a labeled signal set lssnew
containing all the members and
label values of the input sets.
Examples
Merge Labeled Signal Sets
Load a labeled signal set containing recordings of whale songs. Display the names of the set's members and a summary of its label definitions.
load whales
getMemberNames(lss)
ans = 2x1 string
"Member{1}"
"Member{2}"
labelDefinitionsSummary(lss)
ans=3×9 table
LabelName LabelType LabelDataType Categories ValidationFunction DefaultValue Sublabels Tag Description
______________ ___________ _____________ ____________ __________________ ____________ ___________________________ ___ ____________________________
"WhaleType" "attribute" "categorical" {3x1 string} {["N/A" ]} {0x0 double} {0x0 double } "" "Whale type"
"MoanRegions" "roi" "logical" {["N/A" ]} {0x0 double} {0x0 double} {0x0 double } "" "Regions where moans occur"
"TrillRegions" "roi" "logical" {["N/A" ]} {0x0 double} {0x0 double} {1x1 signalLabelDefinition} "" "Regions where trills occur"
Create a new signal set with the same data source, time information, and labels as lss
. Remove the first member of the new set and change the name of the remaining one. Display the names of the new set's members.
newlss = copy(lss);
removeMembers(newlss,1)
setMemberNames(newlss,"YoungOne")
getMemberNames(newlss)
ans = "YoungOne"
Create a label definition that specifies whether a signal corresponds to a calf or to an adult whale. Add the definition to the new labeled signal set and label the member. Remove the label that specifies the moan regions. Display a summary of the new member's label definitions.
calf = signalLabelDefinition("Calf",LabeldataType="logical", ... DefaultValue=false,Description="Is the specimen a calf, or an adult?"); addLabelDefinitions(newlss,calf) setLabelValue(newlss,1,"Calf",true) removeLabelDefinition(newlss,"MoanRegions") labelDefinitionsSummary(newlss)
ans=3×9 table
LabelName LabelType LabelDataType Categories ValidationFunction DefaultValue Sublabels Tag Description
______________ ___________ _____________ ____________ __________________ ____________ ___________________________ ___ ______________________________________
"WhaleType" "attribute" "categorical" {3x1 string} {["N/A" ]} {0x0 double} {0x0 double } "" "Whale type"
"TrillRegions" "roi" "logical" {["N/A" ]} {0x0 double} {0x0 double} {1x1 signalLabelDefinition} "" "Regions where trills occur"
"Calf" "attribute" "logical" {["N/A" ]} {0x0 double} {[ 0]} {0x0 double } "" "Is the specimen a calf, or an adult?"
Merge the two labeled signal sets. Verify that the merged set contains the members, definitions, and labels of the original sets.
lssmerge = merge(lss,newlss); getMemberNames(lssmerge)
ans = 3x1 string
"Member{1}"
"Member{2}"
"YoungOne"
labelDefinitionsSummary(lssmerge)
ans=4×9 table
LabelName LabelType LabelDataType Categories ValidationFunction DefaultValue Sublabels Tag Description
______________ ___________ _____________ ____________ __________________ ____________ ___________________________ ___ ______________________________________
"WhaleType" "attribute" "categorical" {3x1 string} {["N/A" ]} {0x0 double} {0x0 double } "" "Whale type"
"MoanRegions" "roi" "logical" {["N/A" ]} {0x0 double} {0x0 double} {0x0 double } "" "Regions where moans occur"
"TrillRegions" "roi" "logical" {["N/A" ]} {0x0 double} {0x0 double} {1x1 signalLabelDefinition} "" "Regions where trills occur"
"Calf" "attribute" "logical" {["N/A" ]} {0x0 double} {[ 0]} {0x0 double } "" "Is the specimen a calf, or an adult?"
Input Arguments
lss1,...,lssN
— Input labeled signal sets
labeledSignalSet
objects
Input labeled signal sets, specified as labeledSignalSet
objects.
All input sets must have the same time information settings and data source type.
Output Arguments
lssnew
— Merged labeled signal set
labeledSignalSet
object
Merged 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 merged labeled signal set.
Changing the merged labeled signal set does not affect any of the input labeled signal sets.
Version History
Introduced in R2020a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)