Main Content

empty

Class: coder.Dictionary
Namespace: coder

Determine whether Embedded Coder Dictionary is empty

Since R2019b

Syntax

tf = empty(coderDictionaryObj)

Description

tf = empty(coderDictionaryObj) returns true if the coder.Dictionary object coderDictionaryObj is empty. When you remove the Embedded Coder Dictionary from a model or a data dictionary by using coder.dictionary.remove, the Embedded Coder Dictionary becomes empty.

Input Arguments

expand all

Embedded Coder Dictionary, specified as a coder.Dictionary object.

Output Arguments

expand all

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

Examples

expand all

Create a data dictionary named 'dataDict.sldd' in the base workspace, and then create an Embedded Coder Dictionary in the data dictionary. In the base workspace, represent the Embedded Coder Dictionary by using the coder.Dictionary object myCoderDictObj.

Simulink.data.dictionary.create('dataDict.sldd');
myCoderDictObj = coder.dictionary.create('dataDict.sldd');

Check if the Embedded Coder Dictionary is empty. When you created the Embedded Coder Dictionary, definitions from the Simulink package were loaded into it, so the dictionary is initially not empty.

empty(myCoderDictObj)
ans =

  logical

   0

Remove the Embedded Coder Dictionary from the data dictionary and again check to see if it is empty.

coder.dictionary.remove('dataDict.sldd');
empty(myCoderDictObj)
ans =

  logical

   1

Version History

Introduced in R2019b