Main Content

isDictionaryDefault

Class: coder.dictionary.Entry
Namespace: coder.dictionary

Determine if entry is default code definition for a category

Since R2023b

Syntax

tf = isDictionaryDefault(entryObj)

Description

tf = isDictionaryDefault(entryObj) returns true if the entry is the default code definition for its category.

Input Arguments

expand all

Embedded Coder Dictionary entry, specified as a coder.dictionary.Entry object.

Output Arguments

expand all

True or false result, returned as a 1 or 0 of data type logical.

Examples

expand all

Create a Simulink data dictionary that contains an Embedded Coder Dictionary. Create the Embedded Coder Dictionary so that it represents a service interface configuration.

dictionaryFile = Simulink.data.dictionary.create('codeDefinitions.sldd');
codeDictionary = coder.dictionary.create('codeDefinitions.sldd','ServiceInterface');

Create a coder.dictionary.Section object that represents the Measurement Interfaces section of the Embedded Coder Dictionary.

measSect = getSection(codeDictionary, 'MeasurementInterfaces');

Get the coder.dictionary.Entry objects that represent the definitions in the Measurement Interfaces section. For this example, there is one measurement interface entry.

entries = find(measSect)
entries = 

  Entry with properties:

            Name: 'MeasurementExample1'
      DataSource: 'C:\work\codeDefinitions.sldd'
    StorageClass: 'MeasurementStruct'

Determine if the entry MeasurementExample1 is the default measurement interface for the dictionary.

tf = isDictionaryDefault(entries)
tf =

  logical

   1

For this example, the measurement interface entry is the default code definition for measurement interfaces.

Version History

Introduced in R2023b