coder.mapping.utils.create

Create code mappings object for configuring data and function interface for C code generation

    Description

    example

    myCodeMappingObj = coder.mapping.utils.create(model) creates C code mappings environment for the specified model and returns the mappings as object myCodeMappingObj. Code mappings associate model data elements and functions with configurations for C code generation. If code mappings exist for the specified model, the function returns those code mappings.

    example

    myCodeMappingObj = coder.mapping.utils.create(model,configObj) imports default memory section and shared utility naming rule configurations from configuration set configObj while creating C code mappings for the specified model. See Migrate Memory Section and Shared Utility Settings from Configuration Parameters to Code Mappings Editor.

    Examples

    collapse all

    For model myConfigModel, create C code mappings by calling coder.mapping.utils.create. Then, get the code mappings with a call to coder.mapping.api.get.

    myCodeMappingObj = coder.mapping.utils.create('myConfigModel');
    myCodeMappingObj = coder.mapping.api.get('myConfigModel');

    For model myConfigModel, import memory section and shared utility naming rule configurations from configuration set myConfigSet while creating C code mappings.

    myCodeMappingObj = coder.mapping.utils.create('myConfigModel','myLegacyConfigSet');

    After calling this function, call coder.mapping.api.get to get the code mapping object.

    Input Arguments

    collapse all

    Model file for which to create and return a code mappings object, specified as a handle or a character vector or string scalar representing the model name. The model must be loaded (for example, by using load_system) or open. Omit the .slx file extension.

    Example: 'myConfigModel'

    Data Types: char | string | model_handle

    Model configuration object from which to import memory section and shared utility naming rule configurations while creating code mappings for model, specified as a handle, character vector or string scalar. Specify a configuration set object to preserve memory section definitions or shared utility naming rules applied to a model in a version of Embedded Coder® prior to R2018a.

    Example: 'my_legacyConfigset'

    Output Arguments

    collapse all

    The model code mappings, returned as a CodeMapping object.

    Introduced in R2020b