メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

isDefined

クラス: coder.descriptor.TypedRegion
名前空間: coder.descriptor

Determine if data element is defined in generated code

R2025a 以降

構文

tf = isDefined(implementation)

説明

tf = isDefined(implementation) returns 1 (true) if the data element is defined by the generated code. Otherwise, it returns 0 (false).

The data element is defined if all members of the TypedRegion object exist in the generated code.

入力引数

すべて展開する

Description of implementation of data in the generated code, specified as a coder.descriptor.TypedRegion object.

Output Arguments

すべて展開する

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

データ型: logical

すべて展開する

  1. Open the model.

    openExample('CustomCodeComments')
  2. Build the model.

    slbuild('CustomCodeComments')

  3. Create a coder.codedescriptor.CodeDescriptor object for the required model.

    codeDescObj = coder.getCodeDescriptor('CustomCodeComments')
    

  4. Return properties of the Inports data interface type in the generated code.

    dataInterfaces = getDataInterfaces(codeDescObj, 'Inports')
  5. Return properties of the code representation of the first Inport block.

    implementation = dataInterfaces(1).Implementation
  6. Return whether the data element is defined by its code representation.

    isDefined(implementation)

    ans =
      logical
       1

    Since isDefined returned logical 1, all members of implementation exist in the generated code.

バージョン履歴

R2025a で導入