Use signal label definitions to define labels for signals. Labels can be of three types:
Attribute labels define signal characteristics.
Region-of-interest (ROI) labels define signal characteristics over regions of interest.
Point labels define signal characteristics at points of interest.
Each label can have one of four data types:
Logical labels can be either true
or
false
.
Categorical labels can belong to any one of a set of categories that you specify.
Numeric labels can have any numeric value.
String labels can have any value represented by a string.
A label can have any number of sublabels. Sublabels themselves cannot have sublabels.
In Signal Labeler, you can import already existing signalLabelDefinition
objects
stored in MAT-files, or you can create signal label definitions directly in the app.
Example: Create a definition to label a signal with its mean RMS value as a numeric attribute.
At the command line, the code
lblRMS = signalLabelDefinition("MeanRMSattr", ... 'LabelType','attribute','LabelDataType','numeric'); save('MeanRMSdef','lblRMS')
MeanRMSdef.mat
, that you can load into Signal
Labeler to import a label definition called
MeanRMSattr
.In Signal Labeler, click Add Definition ▼ on
the Labeler tab and select Add label
definition
. In the dialog box, specify Label
Name as MeanRMS
, Label Type
as Attribute
, and Data Type as
numeric
.
Example: Create a definition to label the zero
crossings of a signal as "rising"
for positive-going transitions and
"falling"
for negative-going transitions.
At the command line, the code
ldf = signalLabelDefinition("Crosses",'LabelType','point', ... 'LabelDataType','categorical','Categories',["rising","falling"]); save('CrossDef','ldf')
CrossDef.mat
, that you can load into Signal
Labeler to import a label definition called
Crosses
.In Signal Labeler, click Add Definition ▼ on
the Labeler tab and select Add label
definition
. In the dialog box, specify Label
Name as crossings
, Label Type
as Point
, Data Type as
categorical
, and categories as
rising
and falling
, with each category on
a new line.
To import existing signal label definitions, click Import ▼ on
the Labeler tab and select Label Definitions From
file
. In the dialog box, specify the name of the MAT-file that contains the
label definitions you want to import. The MAT-file must contain only one vector of signalLabelDefinition
objects.
To add a signal label definition to your labeled signal set, click Add
Definition ▼ on the Labeler tab and select
Add label definition
. In the dialog box, specify the following fields:
Label Name — Specify the name in the text box.
Label Type — Select one of
Attribute
, ROI
, or
Point
.
Label Description (optional) — Specify the description in the text box.
Data Type — Select one of string
,
numeric
, logical
(the
default), or categorical
.
Categories — This field appears if you specify Data
Type as categorical
. Enter each category on a
new line.
Default (optional) — Specify a default value for the signal
label. For logical
labels, select either
true
or false
. For
categorical
labels, select any of the categories you
specified.
This action is equivalent to using addLabelDefinitions
at the command line.
If you want to reuse the signal label definitions that you created during a Signal Labeler session, you must export the definitions to a MAT-file and import them in a subsequent session.
To add a sublabel definition, select the definition in the Label
Definitions browser, click Add Definition ▼ on the
Labeler tab, and select Add sublabel
definition
. The top of the dialog box shows, as Parent
Name, the name of the label to which you are adding the sublabel.
This action is equivalent to using addLabelDefinitions
at the command line.
To edit a label or sublabel definition, select the definition in the Label Definitions browser and click the Edit button. In the dialog box, specify the following fields:
Label Name — Specify the value in the text box.
Label Description — Specify the value in the text box.
Categories — This field appears if you specify Data
Type as categorical
. You can add categories,
but you cannot remove any existing categories. Enter each new category on a new
line.
Default — Specify a default value for the signal label. For
logical
labels, select either
true
or false
. For
categorical
labels, select any of the categories you
specified.
Editing the default value does not affect existing labels. The new default value applies only to new members, new regions, or new points.
You cannot modify the Label Type or Data Type fields. To change the label type or the data type of a label definition, remove the definition and add a definition with the desired properties.
This action is equivalent to using editLabelDefinition
at the command line.
To delete a label or sublabel definition, select the definition in the Label Definitions browser and click the Delete button on the toolstrip.
This action is equivalent to using removeLabelDefinition
at the command line.