Main Content


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

Return names of the referenced models


refModels = getReferencedModelNames(codeDescObj)


refModels = getReferencedModelNames(codeDescObj) returns a list of referenced models for a coder.codedescriptor.CodeDescriptor object. The list includes only the models that the CodeDescriptor object directly references. For example, if model1 references model2 and model2 references model3, then running getReferencedModelNames from the model1 CodeDescriptor object returns only model2, not model3.

Input Arguments

expand all

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

Output Arguments

expand all

A list of referenced models.


  1. Build the model.


  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 has the list of referenced models.


Version History

Introduced in R2018a