getLabelDefinitions
Get label definitions in labeled signal set
Description
returns a vector of lbldefs
= getLabelDefinitions(lss
)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
.
getLabelDefinitions(
returns a vector of lss
,Name=Value
)signalLabelDefinition
objects that have a label type
and frame policy equal to the values you specify using name-value arguments.
Examples
Get Label Definitions
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
lss
— Labeled signal set
labeledSignalSet
object
Labeled signal set, specified as a labeledSignalSet
object.
Example:
specifies a two-member set of random
signals containing the attribute labeledSignalSet
({randn(100,1)
randn(10,1)},signalLabelDefinition('female'))'female'
.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: getLabelDefinitions(lss,LabelType="roiFeature",FrameSize=50,FrameOverlapLength=5)
returns signalLabelDefinition
objects that contain
roiFeature
labels which have a frame size equal to 50 and a frame
overlap length equal to 5.
LabelType
— Label type
"attribute"
| "roi"
| "point"
| "attributeFeature"
| "roiFeature"
Label type, specified as "attribute"
, "roi"
,
"point"
, "attributeFeature"
, or
"roiFeature"
.
Example: LabelType="attribute"
Data Types: char
| string
FrameSize
— Frame size
numeric scalar
Frame size, specified as a numeric scalar. To enable this argument, set
LabelType
to "roiFeature"
.
Example: LabelType="roiFeature",FrameSize=50
Data Types: double
FrameOverlapLength
— Frame overlap length
numeric scalar
Frame overlap length, specified as a numeric scalar. To enable this argument, set
LabelType
to "roiFeature"
. You cannot
specify FrameOverlapLength
and FrameRate
simultaneously.
When you specify a frame overlap length, the function returns
signalLabelDefinition
objects that contain
roiFeature
labels that have FrameSize
and
FrameOverlapLength
equal to the values you specify.
Example: LabelType="roiFeature",FrameSize=50,FrameOverlapLength=5
Data Types: double
FrameRate
— Frame rate
numeric scalar
Frame rate, specified as a numeric scalar. To enable this argument, set
LabelType
to "roiFeature"
. You cannot
specify FrameRate
and FrameOverlapLength
simultaneously.
When you specify a frame rate, the function returns
signalLabelDefinition
objects that contain
roiFeature
labels that have FrameSize
and
FrameRate
equal to the values you specify.
Example: LabelType="roiFeature",FrameSize=50,FrameRate=45
Data Types: double
Output Arguments
lbldefs
— Signal label definitions
signalLabelDefinition
object
Signal label definitions, returned as a signalLabelDefinition
object or a
vector of such objects.
Version History
Introduced in R2018b
See Also
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)