Main Content

getReferencedModelCodeDescriptor

Class: coder.codedescriptor.CodeDescriptor
Namespace: 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

expand all

Open the model AsynchronousEventsTop.

openExample('AsynchronousEventsTop');

Build the model.

slbuild('AsynchronousEventsTop');

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

codeDescObj = coder.getCodeDescriptor('AsynchronousEventsTop');

Get a list of referenced models included in the model.

refModels = getReferencedModelNames(codeDescObj);
refmodels
refModels = 1x1 cell array
    {'AsynchronousEventsRef'}

Get the coder.codedescriptor.CodeDescriptor object for the referenced model AsynchronousEventsRef.

refCodeDescriptorObj = getReferencedModelCodeDescriptor(codeDescObj, 'AsynchronousEventsRef');
refCodeDescriptorObj
refCodeDescriptorObj =
  CodeDescriptor with properties:
    ModelName: 'AsynchronousEventsRef'
    BuildDir: 'C:\Users\Desktop\Work\slprj\tornado\AsynchronousEventsRef'

Version History

Introduced in R2018a