%% Add Attributes to Label and Sublabel in Label Definition Creator Object for Multisignal Workflow
% Create an empty labelDefinitionCreatorMultisignal object.

ldc = labelDefinitionCreatorMultisignal;

% Add a label with the name 'Car'. Specify the type of label as 'Rectangle'. Adding a 'Rectangle' also adds a 'Cuboid' entry to the label definitions table.

addLabel(ldc,'Car','Rectangle');

% Add an attribute 'Color' to the label 'Car'. Specify the attribute type as 'String' with the value 'Red'.

addAttribute(ldc,'Car','Color','String','Red')

% Add a label with the name 'TrafficLight'. Specify the type of the label as 'Rectangle'. Add a description to the label.

addLabel(ldc,'TrafficLight','Rectangle','Description','Bounding boxes for stop signs');

% Add a sublabel with the name 'RedLight' to the label 'TrafficLight'. Specify the type of the sublabel as 'Rectangle'.

addSublabel(ldc,'TrafficLight','RedLight','Rectangle');

% Add an attribute 'isOn' to the sublabel 'RedLight' in the label 'TrafficLight'. Specify the attribute type for the sublabel as 'logical' with the value false.

addAttribute(ldc,'TrafficLight/RedLight','isOn','logical',false);

% Display the details of the updated labelDefinitionCreatorMultisignal object.

ldc

% Display information about the attribute under the label 'Car' using the object function info.

info(ldc,'Car')

% Display information about the attribute under the label 'TrafficLight' using the object function info.

info(ldc,'TrafficLight')

% Display information about the attribute under the sublabel 'RedLight' in the label 'TrafficLight' using the object function info.

info(ldc,'TrafficLight/RedLight')

% Display information about the attribute 'isOn' under the sublabel 'RedLight' in the label 'TrafficLight' using the object function info.

info(ldc,'TrafficLight/RedLight/isOn')

% Copyright 2019 The MathWorks, Inc.