coder.dictionary.Entry.valid - Determine if coder.dictionary.Entry object represents a valid

  code definition - MATLAB ([original](https://in.mathworks.com/help/ecoder/ref/coder.dictionary.entry.valid.html)) ([raw](?raw))

Main Content

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

Determine if coder.dictionary.Entry object represents a valid code definition

Syntax

tf = valid(entryObj)

Description

[tf](#mw%5F503a20ed-8db8-4355-9d6d-b3b85043c12f) = valid([entryObj](#mw%5Fae2d5098-2c93-49f6-b6e8-2bd3126fb954)) returns true if the coder.dictionary.Entry object entryObj is valid. Acoder.dictionary.Entry object is valid if it represents an existing code definition. When you remove the code definition that the entry represents, thecoder.dictionary.Entry object is not valid.

Input Arguments

Output Arguments

expand all

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

Examples

expand all

Open the model RollAxisAutopilot and represent the Embedded Coder Dictionary by using a coder.Dictionary object. Use this object to access the Storage Classes section of the dictionary and represent the section by using a coder.dictionary.Section object.

openExample('RollAxisAutopilot') coderDictionary = coder.dictionary.open('RollAxisAutopilot'); storageClassesSect = getSection(coderDictionary, 'StorageClasses');

Represent the example storage class ParamStruct by using acoder.dictionary.Entry object.

entryObj = getEntry(storageClassesSect,'ParamStruct');

Check if the coder.dictionary.Entry object in the base workspace represents a valid code definition.

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

deleteEntry(storageClassesSect,'ParamStruct'); valid(entryObj)

Version History

Introduced in R2019b