Main Content

getReferencedModelCodeDescriptor

Class: coder.codedescriptor.CodeDescriptor
Package: coder.codedescriptor

Return coder.codedescriptor.CodeDescriptor object for the specified referenced model

Syntax

refCodeDescriptor = getReferencedModelCodeDescriptor(codeDescObj, refModelName)

Description

refCodeDescriptor = getReferencedModelCodeDescriptor(codeDescObj, refModelName) returns the coder.codedescriptor.CodeDescriptor object for the referenced model specified in refModelName.

Input Arguments

expand all

coder.codedescriptor.CodeDescriptor object for which you want to retrieve the information about generated code.

refModelName can take any name from the list of referenced models returned by getReferencedModelNames().

Output Arguments

expand all

coder.codedescriptor.CodeDescriptor object for the specified referenced model.

Examples

  1. Build the model.

    slbuild('rtwdemo_async_mdlreftop')

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

    codeDescObj = coder.getCodeDescriptor('rtwdemo_async_mdlreftop')
    

  3. Return a list of referenced models.

    refModels = getReferencedModelNames(codeDescObj)

refModels contains the list of referenced models for rtwdemo_async_mdlreftop.

{'rtwdemo_async_mdlrefbot'}
Obtain the coder.codedescriptor.CodeDescriptor object for any of the referenced models.
refCodeDescriptorObj = getReferencedModelCodeDescriptor(codeDescObj, 'rtwdemo_async_mdlrefbot')
refCodeDescriptorObj is the coder.codedescriptor.CodeDescriptor object for rtwdemo_async_mdlrefbot model.
    ModelName: 'rtwdemo_async_mdlrefbot'
     BuildDir: 'C:\Users\Desktop\Work\slprj\tornado\rtwdemo_async_mdlrefbot'

Introduced in R2018a