coder.dictionary.valid - Determine whether coder.Dictionary object represents a valid

  Embedded Coder Dictionary - MATLAB ([original](https://www.mathworks.com/help/ecoder/ref/coder.dictionary.valid.html)) ([raw](?raw))

Main Content

Class: coder.Dictionary
Namespace: coder

Determine whether coder.Dictionary object represents a valid Embedded Coder Dictionary

Syntax

tf = valid(coderDictionaryObj)

Description

[tf](#mw%5F8c4a9966-bc2b-4fb3-a657-5c42bac16534) = valid([coderDictionaryObj](#mw%5Ffe8e1ccb-fb1d-4185-b577-7fd77b622e8e)) returns true if the coder.Dictionary objectcoderDictionaryObj is valid. A coder.Dictionary object is valid if it represents an existing Embedded Coder Dictionary. When you remove the Embedded Coder Dictionary, the coder.Dictionary object is not valid.

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 create an Embedded Coder Dictionary in the data dictionary. Represent the Embedded Coder Dictionary by using the coder.Dictionary objectmyCoderDictObj in the base workspace.

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

Check whether the coder.Dictionary object in the base workspace represents a valid Embedded Coder Dictionary.

Remove the Embedded Coder Dictionary from the data dictionary and check thecoder.Dictionary object again. When you remove the Embedded Coder Dictionary, the coder.Dictionary object is not valid.

coder.dictionary.remove('dataDict.sldd'); valid(myCoderDictObj)

Version History

Introduced in R2019b