Main Content

coder.codedescriptor.CodeDescriptor class

Package: coder.codedescriptor

Return information about generated code

Description

Create a coder.codedescriptor.CodeDescriptor object to access all the methods defined within the code descriptor API. The coder.codedescriptor.CodeDescriptor object describes the data interfaces, function interfaces, global data stores, local and global parameters in the generated code.

Creation

codeDescObj = coder.getCodeDescriptor(model) creates a coder.codedescriptor.CodeDescriptor object for the specified model.

codeDescObj = coder.getCodeDescriptor(folder) creates a coder.codedescriptor.CodeDescriptor object for the model in the build folder specified in folder.

Properties

expand all

Name of the model for which the code descriptor object is invoked.

Example: 'rtwdemo_comments'

Path of the build folder where the model is built.

Example: 'C:\Users\Desktop\Work\rtwdemo_comments_ert_rtw'

Methods

expand all

Examples

collapse all

  1. Build the model.

    slbuild('rtwdemo_comments')
  2. Create a coder.codedescriptor.CodeDescriptor object for the required model.

    codeDescObj = coder.getCodeDescriptor('rtwdemo_comments')
    
        ModelName: 'rtwdemo_comments'
         BuildDir: 'C:\Users\Desktop\Work\rtwdemo_comments_ert_rtw'
  3. Return a list of all available function interface types.

    allFunctionInterfaceTypes = getAllFunctionInterfaceTypes(codeDescObj)
        {'Initialize'}
        {'Output'    }
        {'Update'    }
        {'Terminate' }
Introduced in R2018a